Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tospur
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
felix
tospur
Commits
c4a8cea1
Commit
c4a8cea1
authored
Sep 08, 2015
by
shz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tospur
parent
42721446
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
147 additions
and
15 deletions
+147
-15
wp-content/plugins/tospur/Admin/House.php
+6
-3
wp-content/plugins/tospur/Admin/views/macro.html
+24
-0
wp-content/plugins/tospur/Admin/views/newhouse.html
+3
-0
wp-content/plugins/tospur/Admin/views/save_customer_tracking.html
+43
-0
wp-content/plugins/tospur/Config.php
+2
-0
wp-content/plugins/tospur/Dao/CustomerTrackingDao.php
+57
-0
wp-content/plugins/tospur/index.php
+2
-1
wp-content/themes/tospur/js/iscroll.js
+1
-5
wp-content/themes/tospur/views/sale.html
+9
-6
No files found.
wp-content/plugins/tospur/Admin/House.php
View file @
c4a8cea1
...
@@ -60,11 +60,12 @@ class House extends Tospur_House{
...
@@ -60,11 +60,12 @@ class House extends Tospur_House{
}
else
{
}
else
{
$insert_tospur_house_array
[
'status'
]
=
$_POST
[
'status'
];
$insert_tospur_house_array
[
'status'
]
=
$_POST
[
'status'
];
$result
=
House
::
data_insert
(
$insert_tospur_house_array
);
$result
=
House
::
data_insert
(
$insert_tospur_house_array
);
if
(
$result
!=
200
){
if
(
$result
==
506
){
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
print_r
(
$result
);;
print_r
(
$result
);;
echo
"新增房源失败"
;
echo
"新增房源失败"
;
}
else
{
}
else
{
$house_id
=
$result
;
$wpdb
->
query
(
"COMMIT"
);
$wpdb
->
query
(
"COMMIT"
);
echo
"新增房源成功"
;
echo
"新增房源成功"
;
}
}
...
@@ -143,6 +144,7 @@ class House extends Tospur_House{
...
@@ -143,6 +144,7 @@ class House extends Tospur_House{
echo
"推荐置业顾问修改失败"
;
echo
"推荐置业顾问修改失败"
;
}
}
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
CustomerTrackingDao
::
insert
(
$houseId
,
$_REQUEST
);
return
$result
;
return
$result
;
}
}
...
@@ -166,10 +168,12 @@ class House extends Tospur_House{
...
@@ -166,10 +168,12 @@ class House extends Tospur_House{
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
CustomerTrackingDao
::
insert
(
$houseId
,
$_REQUEST
);
return
$houseId
;
}
else
{
}
else
{
return
506
;
return
506
;
}
}
return
200
;
}
}
}
}
\ No newline at end of file
wp-content/plugins/tospur/Admin/views/macro.html
0 → 100644
View file @
c4a8cea1
{# 定义宏以便多次调用 #}
{% macro customer_tracking_list(houseId) %}
{% set list = function('CustomerTrackingDao::search', houseId) %}
<button
class=
"button"
style=
"margin-bottom: 20px;"
>
房源跟进
</button>
{% if list %}
<table
class=
"table table-bordered"
>
<tr>
<th
class=
"col-md-2 text-center"
>
跟进类型
</th>
<th
class=
"col-md-3 text-center"
>
置业顾问
</th>
<th
class=
"col-md-3 text-center"
>
时间
</th>
<th
class=
"col-md-4 text-center"
>
跟进说明
</th>
</tr>
{% for item in list %}
<tr>
<td
class=
"col-md-2 text-center"
>
{{ item.status_name }}
</td>
<td
class=
"col-md-3 text-center"
>
{{ item.name }}
</td>
<td
class=
"col-md-3 text-center"
>
{{ item.time }}
</td>
<td
class=
"col-md-4 text-center"
>
{{ item.description }}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endmacro %}
\ No newline at end of file
wp-content/plugins/tospur/Admin/views/newhouse.html
View file @
c4a8cea1
{% import "macro.html" as macro %}
<!DOCTYPE HTML>
<!DOCTYPE HTML>
<html>
<html>
<head>
<head>
...
@@ -290,6 +291,8 @@
...
@@ -290,6 +291,8 @@
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
{{ macro.customer_tracking_list(houseId) }}
{% include "save_customer_tracking.html" %}
<input
type=
"text"
name=
"type"
value=
"1"
hidden=
"hidden"
>
<input
type=
"text"
name=
"type"
value=
"1"
hidden=
"hidden"
>
{% if houseId %}
{% if houseId %}
<input
type=
"text"
name=
"houseId"
value=
"{{houseId}}"
hidden=
"hidden"
>
<input
type=
"text"
name=
"houseId"
value=
"{{houseId}}"
hidden=
"hidden"
>
...
...
wp-content/plugins/tospur/Admin/views/save_customer_tracking.html
0 → 100644
View file @
c4a8cea1
<style>
.customer_tracking
h2
{
margin-bottom
:
30px
;
}
.customer_tracking
p
{
margin
:
20px
0
;
}
.customer_tracking
p
span
:nth-of-type
(
1
)
{
font-weight
:
bold
;
font-size
:
14px
;
display
:
inline-block
;
width
:
100px
;
}
.customer_tracking
p
span
:nth-of-type
(
2
)
{
font-size
:
14px
;
display
:
inline-block
;
width
:
400px
;
}
</style>
<div
class=
"customer_tracking"
>
<h2>
新增客户跟踪
</h2>
<h4>
跟进记录
</h4>
<p>
<span>
跟进类型:
</span>
<span>
<select
id=
"customer_tracking_status"
name=
"customer_tracking_status"
>
{% set customer_tracking_status = function('CustomerTrackingDao::search_status') %}
{% for item in customer_tracking_status %}
<option
value=
"{{ item.status_id }}"
>
{{ item.status_name }}
</option>
{% endfor %}
</select>
<label
for=
"customer_tracking_status"
></label>
</span>
</p>
<p>
<span
style=
"vertical-align: top;"
>
跟进说明:
</span>
<span>
<textarea
rows=
"8"
id=
"description"
name=
"description"
class=
"form-control"
style=
"width: 250px;resize: none;"
></textarea>
<label
for=
"description"
></label>
</span>
</p>
</div>
\ No newline at end of file
wp-content/plugins/tospur/Config.php
View file @
c4a8cea1
...
@@ -25,6 +25,8 @@ class Config {
...
@@ -25,6 +25,8 @@ class Config {
const
TOSPUR_VERIFY_TABLE
=
'tospur_verify'
;
const
TOSPUR_VERIFY_TABLE
=
'tospur_verify'
;
const
TOSPUR_SALE_TABLE
=
'tospur_sale'
;
const
TOSPUR_SALE_TABLE
=
'tospur_sale'
;
const
WP_USERS_TABLE
=
'wp_users'
;
const
WP_USERS_TABLE
=
'wp_users'
;
const
TOSPUR_STATUS_TABLE
=
'tospur_status'
;
const
TOSPUR_CUSTOMER_TRACKING_TABLE
=
'tospur_customer_tracking'
;
//sync url
//sync url
...
...
wp-content/plugins/tospur/Dao/CustomerTrackingDao.php
0 → 100644
View file @
c4a8cea1
<?php
require_once
(
PLUGIN_DIR
.
'Config.php'
);
class
CustomerTrackingDao
{
public
static
function
insert
(
$house_id
,
$request
)
{
$page
=
$request
[
'page'
];
$origin
=
0
;
switch
(
$page
)
{
case
'newHouse'
:
case
'secHandHouse'
:
case
'rentHouse'
:
$origin
=
1
;
break
;
case
'customer'
:
$origin
=
2
;
break
;
}
global
$wpdb
;
$array
=
array
(
'house_id'
=>
$house_id
,
'status_type'
=>
$request
[
'customer_tracking_status'
],
'consultant_id'
=>
wp_get_current_user
()
->
ID
,
'time'
=>
current_time
(
'Y-m-d H:i:s'
),
'description'
=>
$request
[
'description'
],
'origin'
=>
$origin
);
$result
=
$wpdb
->
insert
(
Config
::
TOSPUR_CUSTOMER_TRACKING_TABLE
,
$array
);
if
(
$result
)
{
return
$wpdb
->
insert_id
;
}
else
{
return
'新增客户跟踪失败'
;
}
}
public
static
function
search
(
$house_id
)
{
global
$wpdb
;
$sql
=
'SELECT tct.*,ts.status_name,tc.name FROM '
.
Config
::
TOSPUR_CUSTOMER_TRACKING_TABLE
.
' tct'
.
' left join (SELECT * FROM '
.
Config
::
TOSPUR_STATUS_TABLE
.
' where status_type = 3) as ts on tct.status_type = ts.status_id'
.
' left join '
.
Config
::
TOSPUR_CONSULTANT
.
' tc on tct.consultant_id = tc.id'
.
' where tct.house_id = '
.
$house_id
;
return
$wpdb
->
get_results
(
$sql
);
}
public
static
function
search_status
()
{
global
$wpdb
;
$sql
=
'SELECT * FROM '
.
Config
::
TOSPUR_STATUS_TABLE
.
' where status_type = 3'
;
return
$wpdb
->
get_results
(
$sql
);
}
}
?>
\ No newline at end of file
wp-content/plugins/tospur/index.php
View file @
c4a8cea1
...
@@ -28,6 +28,7 @@ function tospur_init()
...
@@ -28,6 +28,7 @@ function tospur_init()
require_once
(
'consultant_score.php'
);
require_once
(
'consultant_score.php'
);
require_once
(
'view_house.php'
);
require_once
(
'view_house.php'
);
require_once
(
'tospur_sale.php'
);
require_once
(
'tospur_sale.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/CustomerTrackingDao.php'
);
add_action
(
'admin_menu'
,
'reset_menu'
);
add_action
(
'admin_menu'
,
'reset_menu'
);
tospur_register_script_style
();
tospur_register_script_style
();
tospur_ajax_set
();
tospur_ajax_set
();
...
@@ -144,7 +145,7 @@ function update_consultant()
...
@@ -144,7 +145,7 @@ function update_consultant()
function
reset_menu
()
function
reset_menu
()
{
{
add_menu_page
(
"sync"
,
"同步数据"
,
"manage_options"
,
"1"
,
"do_sync"
);
add_menu_page
(
"sync"
,
"同步数据"
,
"manage_options"
,
"1"
,
"do_sync"
);
add_menu_page
(
'ne
s
HouseList'
,
'新房列表'
,
'moderate_comments'
,
'newHouseList'
,
'function_newHouseList'
,
'dashicons-menu'
,
6
);
add_menu_page
(
'ne
w
HouseList'
,
'新房列表'
,
'moderate_comments'
,
'newHouseList'
,
'function_newHouseList'
,
'dashicons-menu'
,
6
);
add_submenu_page
(
'newHouseList'
,
'添加新房'
,
'添加新房'
,
'moderate_comments'
,
'newHouse'
,
'House::init_view'
);
add_submenu_page
(
'newHouseList'
,
'添加新房'
,
'添加新房'
,
'moderate_comments'
,
'newHouse'
,
'House::init_view'
);
add_menu_page
(
'secHandHouseList'
,
'二手房列表'
,
'moderate_comments'
,
'secHandHouseList'
,
'function_secHandHouseList'
,
'dashicons-menu'
,
7
);
add_menu_page
(
'secHandHouseList'
,
'二手房列表'
,
'moderate_comments'
,
'secHandHouseList'
,
'function_secHandHouseList'
,
'dashicons-menu'
,
7
);
add_submenu_page
(
'secHandHouseList'
,
'添加二手房'
,
'添加二手房'
,
'moderate_comments'
,
'secHandHouse'
,
'SecHandHouse::secHandHouse_html'
);
add_submenu_page
(
'secHandHouseList'
,
'添加二手房'
,
'添加二手房'
,
'moderate_comments'
,
'secHandHouse'
,
'SecHandHouse::secHandHouse_html'
);
...
...
wp-content/themes/tospur/js/iscroll.js
View file @
c4a8cea1
...
@@ -1571,11 +1571,7 @@ IScroll.prototype = {
...
@@ -1571,11 +1571,7 @@ IScroll.prototype = {
this
.
_key
(
e
);
this
.
_key
(
e
);
break
;
break
;
case
'click'
:
case
'click'
:
if
(
!
e
.
_constructed
)
{
if
(
!
e
.
_constructed
)
{
if
(
!
e
.
_constructed
&&
target
.
type
!=
"submit"
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
}
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
}
}
...
...
wp-content/themes/tospur/views/sale.html
View file @
c4a8cea1
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<script
type=
"text/javascript"
src=
"{{ theme }}/js/iscroll.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/iscroll.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.validate.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.validate.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.mobile.custom.min.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/bootstrap.min.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/bootstrap.min.js"
></script>
</head>
</head>
<body>
<body>
...
@@ -211,7 +212,7 @@
...
@@ -211,7 +212,7 @@
<script>
<script>
var
notice
;
var
notice
;
var
myModal
;
var
myModal
;
var
flag
=
tru
e
;
var
flag
=
fals
e
;
var
user_id
=
'{{ user_id }}'
;
var
user_id
=
'{{ user_id }}'
;
var
phone
=
'{{ phone }}'
;
var
phone
=
'{{ phone }}'
;
var
myScroll
;
var
myScroll
;
...
@@ -304,15 +305,12 @@
...
@@ -304,15 +305,12 @@
},
},
submitHandler
:
function
(
form
)
{
submitHandler
:
function
(
form
)
{
flag
=
true
;
flag
=
true
;
}
});
form
.
submit
(
function
()
{
if
(
flag
)
{
if
(
flag
)
{
var
house_type
=
form
.
data
(
'house'
);
var
house_type
=
$
(
form
)
.
data
(
'house'
);
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
data
:
'action=submit_sale&user_id='
+
user_id
+
'&phone='
+
phone
+
'&house_type='
+
house_type
+
'&'
+
form
.
serialize
(),
data
:
'action=submit_sale&user_id='
+
user_id
+
'&phone='
+
phone
+
'&house_type='
+
house_type
+
'&'
+
$
(
form
)
.
serialize
(),
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
2000
)
{
if
(
data
.
code
==
2000
)
{
notice
.
html
(
'<span>提交成功</span>'
);
notice
.
html
(
'<span>提交成功</span>'
);
...
@@ -326,6 +324,11 @@
...
@@ -326,6 +324,11 @@
}
}
});
});
}
}
}
});
form
.
find
(
'input[type=submit]'
).
tap
(
function
()
{
alert
(
'111'
);
form
.
submit
();
return
false
;
return
false
;
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment