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
5d92fe11
Commit
5d92fe11
authored
Sep 10, 2015
by
shz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每日一更
parent
b3fa582f
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
188 additions
and
181 deletions
+188
-181
wp-content/plugins/tospur/Admin/consultant_score.php
+1
-1
wp-content/plugins/tospur/Admin/customer.php
+9
-8
wp-content/plugins/tospur/Admin/customerList.php
+77
-51
wp-content/plugins/tospur/Admin/view_house.php
+1
-1
wp-content/plugins/tospur/Admin/views/customer.html
+4
-18
wp-content/plugins/tospur/Admin/views/customerDetail.html
+13
-3
wp-content/plugins/tospur/Admin/views/customerList.html
+38
-61
wp-content/plugins/tospur/Dao/CustomerDao.php
+33
-0
wp-content/plugins/tospur/Dao/InsertDao.php
+0
-12
wp-content/plugins/tospur/Dao/SearchDao.php
+0
-15
wp-content/plugins/tospur/index.php
+11
-10
wp-content/themes/tospur/functions.php
+1
-1
No files found.
wp-content/plugins/tospur/Admin/consultant_score.php
View file @
5d92fe11
...
@@ -175,7 +175,7 @@ class consultantScoreList extends WP_List_Table
...
@@ -175,7 +175,7 @@ class consultantScoreList extends WP_List_Table
function
add_consultant_score_menu
()
function
add_consultant_score_menu
()
{
{
add_menu_page
(
'置业顾问评分'
,
'置业顾问评分'
,
'
activate_plugin
s'
,
'consultant_score'
,
'consultant_score_page'
,
'dashicons-menu'
,
26
);
add_menu_page
(
'置业顾问评分'
,
'置业顾问评分'
,
'
moderate_comment
s'
,
'consultant_score'
,
'consultant_score_page'
,
'dashicons-menu'
,
26
);
}
}
add_action
(
'admin_menu'
,
'add_consultant_score_menu'
);
add_action
(
'admin_menu'
,
'add_consultant_score_menu'
);
...
...
wp-content/plugins/tospur/Admin/customer.php
View file @
5d92fe11
...
@@ -51,6 +51,7 @@ class customer extends Tospur_House
...
@@ -51,6 +51,7 @@ class customer extends Tospur_House
'bathroom'
=>
$_POST
[
'bathroom'
],
'bathroom'
=>
$_POST
[
'bathroom'
],
'origin_remark'
=>
$_POST
[
'origin_remark'
],
'origin_remark'
=>
$_POST
[
'origin_remark'
],
'consultant_id'
=>
$_POST
[
'consultant_id'
],
'consultant_id'
=>
$_POST
[
'consultant_id'
],
//(1)
'status'
=>
$_POST
[
'status'
]
'status'
=>
$_POST
[
'status'
]
);
);
if
(
$_POST
)
{
if
(
$_POST
)
{
...
@@ -68,7 +69,7 @@ class customer extends Tospur_House
...
@@ -68,7 +69,7 @@ class customer extends Tospur_House
echo
"修改客源失败"
;
echo
"修改客源失败"
;
}
}
}
else
{
}
else
{
$id
=
Insert
Dao
::
insert_customer
(
$insert_tospur_house_array
);
$id
=
Customer
Dao
::
insert_customer
(
$insert_tospur_house_array
);
if
(
$id
)
{
if
(
$id
)
{
$wpdb
->
query
(
"COMMIT"
);
$wpdb
->
query
(
"COMMIT"
);
echo
"新增客源成功"
;
echo
"新增客源成功"
;
...
@@ -80,11 +81,16 @@ class customer extends Tospur_House
...
@@ -80,11 +81,16 @@ class customer extends Tospur_House
exit
;
exit
;
}
else
if
(
isset
(
$_GET
[
'edit'
]))
{
}
else
if
(
isset
(
$_GET
[
'edit'
]))
{
$context
[
'houseId'
]
=
$_GET
[
'id'
];
$context
[
'houseId'
]
=
$_GET
[
'id'
];
$context
=
array_merge
(
$context
,
Search
Dao
::
searchCustomer
(
$_GET
[
'id'
]));
$context
=
array_merge
(
$context
,
Customer
Dao
::
searchCustomer
(
$_GET
[
'id'
]));
$context
[
"district"
]
=
SearchDao
::
searchCity
(
$context
[
'result'
]
->
city_id
);
$context
[
"district"
]
=
SearchDao
::
searchCity
(
$context
[
'result'
]
->
city_id
);
$context
[
"plate"
]
=
SearchDao
::
searchCity
(
$context
[
'result'
]
->
city_id
,
$context
[
'result'
]
->
district_id
);
$context
[
"plate"
]
=
SearchDao
::
searchCity
(
$context
[
'result'
]
->
city_id
,
$context
[
'result'
]
->
district_id
);
}
}
$context
[
'role'
]
=
customer
::
getCurrentRole
();
$current_user
=
wp_get_current_user
();
$context
[
'role'
]
=
$current_user
->
roles
[
0
];
if
(
$context
[
'role'
]
==
'author'
)
{
$context
[
'consultant_id'
]
=
$current_user
->
ID
;
}
$context
[
'city'
]
=
SearchDao
::
searchCity
();
$context
[
'city'
]
=
SearchDao
::
searchCity
();
$context
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
$context
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
$context
[
'room'
]
=
SearchDao
::
searchRoom
();
$context
[
'room'
]
=
SearchDao
::
searchRoom
();
...
@@ -95,10 +101,5 @@ class customer extends Tospur_House
...
@@ -95,10 +101,5 @@ class customer extends Tospur_House
}
}
Timber
::
render
(
'customer.html'
,
$context
);
Timber
::
render
(
'customer.html'
,
$context
);
}
}
public
static
function
data_update
(
$houseId
,
$params
)
{
}
}
}
wp-content/plugins/tospur/Admin/customerList.php
View file @
5d92fe11
...
@@ -8,89 +8,103 @@ class customerList extends WP_List_Table
...
@@ -8,89 +8,103 @@ class customerList extends WP_List_Table
{
{
function
__construct
()
function
__construct
()
{
{
global
$status
,
$page
;
//Set parent defaults
parent
::
__construct
(
array
(
'singular'
=>
'customerList'
,
//singular name of the listed records
'plural'
=>
'customerLists'
,
//plural name of the listed records
'ajax'
=>
false
//does this table support ajax?
));
}
}
function
column_default
(
$item
,
$column_name
)
function
column_default
(
$item
,
$column_name
)
{
{
switch
(
$column_name
)
{
switch
(
$column_name
)
{
case
'id'
:
case
'name'
:
case
'name'
:
case
'address'
:
return
'<a href="'
.
admin_url
(
'admin.php?page=customer&edit=true&id='
.
$item
[
'id'
])
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
case
'average_price'
:
case
'developer'
:
case
'check_in_time'
:
case
'room_id'
:
case
'property_age'
:
case
'decoration'
:
case
'covered_area'
:
case
'status'
:
case
'volume_rate'
:
case
'greening_rate'
:
case
'households'
:
case
'parking_spaces'
:
case
'property_management'
:
case
'property_money'
:
default
:
default
:
return
'<a href="'
.
admin_url
()
.
'admin.php?page=newHouse&edit=true&id='
.
$item
[
'id'
]
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
return
$item
[
$column_name
];
}
}
}
function
column_cb
(
$item
)
{
return
sprintf
(
'<input type="checkbox" name="%1$s[]" value="%2$s" />'
,
/*$1%s*/
$this
->
_args
[
'singular'
],
//Let's simply repurpose the table's singular label ("score")
/*$2%s*/
$item
[
'id'
]
//The value of the checkbox should be the record's id
);
}
}
function
get_columns
()
function
get_columns
()
{
{
if
(
current_user_can
(
'administrator'
))
{
$columns
=
array
(
'cb'
=>
'<input type="checkbox" />'
);
}
$columns
[
'name'
]
=
'姓名'
;
$columns
[
'name'
]
=
'姓名'
;
$columns
[
'demand_type'
]
=
'需求类型'
;
$columns
[
'demand_type'
]
=
'需求类型'
;
$columns
[
'customer_remark'
]
=
'客户备注'
;
$columns
[
'customer_remark'
]
=
'客户备注'
;
$columns
[
'consultant'
]
=
'置业顾问'
;
$columns
[
'consultant
_name
'
]
=
'置业顾问'
;
$columns
[
'
check_in_ti
me'
]
=
'状态'
;
$columns
[
'
status_na
me'
]
=
'状态'
;
return
$columns
;
return
$columns
;
}
}
function
get_sortable_columns
()
{
$sortable_columns
=
array
();
return
$sortable_columns
;
}
function
prepare_items
()
function
prepare_items
()
{
{
global
$wpdb
;
global
$wpdb
;
$per_page
=
10
;
$per_page
=
10
;
$columns
=
$this
->
get_columns
();
$columns
=
$this
->
get_columns
();
$hidden
=
array
();
$hidden
=
array
();
$sortable
=
$this
->
get_sortable_columns
();
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
$this
->
_column_headers
=
array
(
$columns
,
$hidden
);
$sql
=
"select * from tospur_customer tc"
;
$sql
=
"SELECT tcs.*,tc.name as consultant_name,ts.status_name FROM tospur_customer tcs"
.
" left join (SELECT * FROM tospur_status where status_type = 5) as ts on tcs.status = ts.status_id"
.
" left join tospur_consultant tc on tcs.consultant_id = tc.id where 1 = 1"
;
if
(
isset
(
$_POST
[
'status'
])
&&
$_POST
[
'status'
]
!=
-
1
)
{
$sql
=
$sql
.
" and tcs.status = "
.
$_POST
[
'status'
];
}
if
(
isset
(
$_POST
[
'customer_type'
])
&&
$_POST
[
'customer_type'
]
!=
-
1
)
{
$sql
=
$sql
.
" and tcs.customer_type = "
.
$_POST
[
'customer_type'
];
}
if
(
isset
(
$_POST
[
'demand_type'
])
&&
$_POST
[
'demand_type'
]
!=
-
1
)
{
$demand_type
=
null
;
switch
(
$_POST
[
'demand_type'
])
{
case
0
:
$demand_type
=
'tcs.new_house'
;
break
;
case
1
:
$demand_type
=
'tcs.secondHand_house'
;
break
;
case
2
:
$demand_type
=
'tcs.rent_house'
;
break
;
}
if
(
$demand_type
)
{
$sql
=
$sql
.
" and "
.
$demand_type
.
" = 1"
;
}
}
if
(
isset
(
$_POST
[
'search_name'
]))
{
$sql
=
$sql
.
" and tcs.name like '%"
.
$_POST
[
'search_name'
]
.
"%'"
;
}
if
(
isset
(
$_POST
[
'search_consultant_name'
]))
{
$sql
=
$sql
.
" and tc.name like '%"
.
$_POST
[
'search_consultant_name'
]
.
"%'"
;
}
if
(
isset
(
$_POST
[
'search_phone'
]))
{
$sql
=
$sql
.
" and tcs.phone like '%"
.
$_POST
[
'search_phone'
]
.
"%'"
;
}
if
(
isset
(
$_POST
[
'search_min_time'
]))
{
$sql
=
$sql
.
" and tcs.time >= '"
.
$_POST
[
'search_min_time'
]
.
"'"
;
}
if
(
isset
(
$_POST
[
'search_max_time'
]))
{
$sql
=
$sql
.
" and tcs.time <= '"
.
$_POST
[
'search_max_time'
]
.
"'"
;
}
$result
=
$wpdb
->
get_results
(
$sql
);
$result
=
$wpdb
->
get_results
(
$sql
);
$data
=
array
();
$data
=
array
();
foreach
(
$result
as
$key
=>
$value
)
{
foreach
(
$result
as
$key
=>
$value
)
{
$demand_type_array
=
array
(
(
$value
->
new_house
==
1
)
?
'新房'
:
null
,
(
$value
->
secondHand_house
==
1
)
?
'二手房'
:
null
,
(
$value
->
rent_house
==
1
)
?
'租房'
:
null
);
$demand_type_array
=
array_filter
(
$demand_type_array
,
function
(
$var
)
{
return
!
is_null
(
$var
);
});
$data
[
$key
]
=
array
(
'id'
=>
$value
->
id
,
'name'
=>
$value
->
name
,
'demand_type'
=>
implode
(
"、"
,
$demand_type_array
),
'customer_remark'
=>
$value
->
customer_remark
,
'consultant_name'
=>
$value
->
consultant_name
,
'status_name'
=>
$value
->
status_name
);
}
}
$current_page
=
$this
->
get_pagenum
();
$current_page
=
$this
->
get_pagenum
();
if
(
isset
(
$_POST
[
'paged'
]))
{
$current_page
=
$_POST
[
'paged'
];
}
$total_items
=
count
(
$data
);
$total_items
=
count
(
$data
);
...
@@ -109,6 +123,18 @@ class customerList extends WP_List_Table
...
@@ -109,6 +123,18 @@ class customerList extends WP_List_Table
function
function_customerList
()
function
function_customerList
()
{
{
$context
=
array
();
$context
=
array
();
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
5
);
$context
[
'customer_type'
]
=
SearchDao
::
searchStatusType
(
6
);
$context
[
'status_id'
]
=
$_POST
[
'status'
];
$context
[
'demand_type'
]
=
isset
(
$_POST
[
'demand_type'
])
?
$_POST
[
'demand_type'
]
:
-
1
;
$context
[
'customer_type_id'
]
=
isset
(
$_POST
[
'customer_type'
])
?
$_POST
[
'customer_type'
]
:
-
1
;
$context
[
'search_name'
]
=
$_POST
[
'search_name'
];
$context
[
'search_consultant_name'
]
=
$_POST
[
'search_consultant_name'
];
$context
[
'search_phone'
]
=
$_POST
[
'search_phone'
];
$context
[
'search_min_time'
]
=
$_POST
[
'search_min_time'
];
$context
[
'search_max_time'
]
=
$_POST
[
'search_max_time'
];
Timber
::
render
(
"customerList.html"
,
$context
);
Timber
::
render
(
"customerList.html"
,
$context
);
}
}
...
...
wp-content/plugins/tospur/Admin/view_house.php
View file @
5d92fe11
...
@@ -129,7 +129,7 @@ class viewHouseList extends WP_List_Table
...
@@ -129,7 +129,7 @@ class viewHouseList extends WP_List_Table
function
add_view_house_menu
()
function
add_view_house_menu
()
{
{
add_menu_page
(
'预约列表'
,
'预约列表'
,
'
activate_plugin
s'
,
'view_house'
,
'view_house_page'
,
'dashicons-menu'
,
27
);
add_menu_page
(
'预约列表'
,
'预约列表'
,
'
moderate_comment
s'
,
'view_house'
,
'view_house_page'
,
'dashicons-menu'
,
27
);
}
}
add_action
(
'admin_menu'
,
'add_view_house_menu'
);
add_action
(
'admin_menu'
,
'add_view_house_menu'
);
...
...
wp-content/plugins/tospur/Admin/views/customer.html
View file @
5d92fe11
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
</div>
</div>
<div
class=
"col-md-1"
>
<div
class=
"col-md-1"
>
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"position: fixed;"
>
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"position: fixed;"
>
{% if role == 'administrator' %}
{% if role == 'administrator'
or role == 'editor'
%}
<div
class=
"row"
style=
"position: fixed;top:50px;"
>
<div
class=
"row"
style=
"position: fixed;top:50px;"
>
<select
id=
"status"
name=
"status"
>
<select
id=
"status"
name=
"status"
>
{% for item in status %}
{% for item in status %}
...
@@ -80,9 +80,6 @@
...
@@ -80,9 +80,6 @@
<script>
<script>
(
function
(
$
){
(
function
(
$
){
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
"#check_in_time"
).
datepicker
({
dateFormat
:
"yy-mm-dd"
});
//基本信息的联动AJAX
//基本信息的联动AJAX
$
(
"#baseCity"
).
change
(
function
(){
$
(
"#baseCity"
).
change
(
function
(){
var
cityId
=
$
(
"#baseCity"
).
val
();
var
cityId
=
$
(
"#baseCity"
).
val
();
...
@@ -174,22 +171,10 @@
...
@@ -174,22 +171,10 @@
});
});
//删除置业顾问
//删除置业顾问
$
(
"#consultantImg"
).
on
(
"click"
,
".
imgCancel,.consultantCancel,.picDelet,.feature
Cancel"
,
function
(){
$
(
"#consultantImg"
).
on
(
"click"
,
".
consultant
Cancel"
,
function
(){
$
(
this
).
parents
(
"p"
).
remove
();
$
(
this
).
parents
(
"p"
).
remove
();
});
});
$
(
"#consultantImg"
).
on
(
"click"
,
".existsCancel"
,
function
(){
$
(
this
).
parent
().
remove
();
});
$
(
"input[id='keyCheck']"
).
change
(
function
(){
textDisable
(
"keyCheck"
,
"key"
);
});
$
(
"input[id='garageCheck']"
).
change
(
function
(){
textDisable
(
"garageCheck"
,
"garage"
);
});
$
(
'#customerForm'
).
validate
({
$
(
'#customerForm'
).
validate
({
onkeyup
:
false
,
onkeyup
:
false
,
onfocusout
:
false
,
onfocusout
:
false
,
...
@@ -221,7 +206,8 @@
...
@@ -221,7 +206,8 @@
errorLabelContainer
:
"#notice"
,
errorLabelContainer
:
"#notice"
,
errorElement
:
'div'
,
errorElement
:
'div'
,
submitHandler
:
function
(
form
)
{
submitHandler
:
function
(
form
)
{
if
(
$
(
"#consultantImg > p"
).
length
==
0
)
{
var
consultantImg
=
$
(
'#consultantImg'
);
if
(
consultantImg
.
length
==
1
&&
consultantImg
.
find
(
'p'
).
length
==
0
)
{
alert
(
"请选择置业顾问"
);
alert
(
"请选择置业顾问"
);
}
else
{
}
else
{
form
.
submit
();
form
.
submit
();
...
...
wp-content/plugins/tospur/Admin/views/customerDetail.html
View file @
5d92fe11
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<label
for=
"check_in_time"
>
入住时间:
</label>
<label
for=
"check_in_time"
>
入住时间:
</label>
<input
type=
"
text
"
name=
"check_in_time"
id=
"check_in_time"
value=
"{{ result.check_in_time }}"
class=
"form-control"
>
<input
type=
"
date
"
name=
"check_in_time"
id=
"check_in_time"
value=
"{{ result.check_in_time }}"
class=
"form-control"
>
</div>
</div>
</div>
</div>
<br>
<br>
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<label
for=
"propertyRight"
>
产权:
</label>
<label
for=
"propertyRight"
>
产权:
</label>
<select
name=
"propertyRight"
id=
"propertyRight"
class=
"form-control"
>
<select
name=
"propertyRight"
id=
"propertyRight"
class=
"form-control"
>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
<option
value=
"个人产权"
>
个人产权
</option>
<option
value=
"个人产权"
>
个人产权
</option>
<option
value=
"单位产权"
>
单位产权
</option>
<option
value=
"单位产权"
>
单位产权
</option>
<option
value=
"售后产权"
>
售后产权
</option>
<option
value=
"售后产权"
>
售后产权
</option>
...
@@ -96,7 +97,7 @@
...
@@ -96,7 +97,7 @@
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<label
for=
"decoration"
>
装修:
</label>
<label
for=
"decoration"
>
装修:
</label>
<select
name=
"decoration"
id=
"decoration"
class=
"form-control"
>
<select
name=
"decoration"
id=
"decoration"
class=
"form-control"
>
<option
value=
"不限"
>
不限
</option>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
<option
value=
"毛坯"
>
毛坯
</option>
<option
value=
"毛坯"
>
毛坯
</option>
<option
value=
"简单装修"
>
简单装修
</option>
<option
value=
"简单装修"
>
简单装修
</option>
<option
value=
"中等装修"
>
中等装修
</option>
<option
value=
"中等装修"
>
中等装修
</option>
...
@@ -110,7 +111,7 @@
...
@@ -110,7 +111,7 @@
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<label
for=
"age"
>
年代:
</label>
<label
for=
"age"
>
年代:
</label>
<select
name=
"age"
id=
"age"
class=
"form-control"
>
<select
name=
"age"
id=
"age"
class=
"form-control"
>
<option
value=
"不限"
>
不限
</option>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
{% for item in age %}
{% for item in age %}
<option
value=
"{{ item }}"
>
{{ item }}
</option>
<option
value=
"{{ item }}"
>
{{ item }}
</option>
{% endfor %}
{% endfor %}
...
@@ -119,6 +120,7 @@
...
@@ -119,6 +120,7 @@
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<label
for=
"faceto"
>
朝向:
</label>
<label
for=
"faceto"
>
朝向:
</label>
<select
name=
"faceto"
id=
"faceto"
class=
"form-control"
>
<select
name=
"faceto"
id=
"faceto"
class=
"form-control"
>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
<option
value=
"其他"
>
其他
</option>
<option
value=
"其他"
>
其他
</option>
<option
value=
"东"
>
东
</option>
<option
value=
"东"
>
东
</option>
<option
value=
"南"
>
南
</option>
<option
value=
"南"
>
南
</option>
...
@@ -139,6 +141,7 @@
...
@@ -139,6 +141,7 @@
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<label>
户型:
</label>
<label>
户型:
</label>
<select
name=
"bedroom"
id=
"bedroom"
class=
"form-control"
>
<select
name=
"bedroom"
id=
"bedroom"
class=
"form-control"
>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
<option
value=
"0"
>
0
</option>
<option
value=
"0"
>
0
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"2"
>
2
</option>
...
@@ -151,6 +154,7 @@
...
@@ -151,6 +154,7 @@
</select>
</select>
<label
for=
"bedroom"
>
室
</label>
<label
for=
"bedroom"
>
室
</label>
<select
name=
"hall"
id=
"hall"
class=
"form-control"
>
<select
name=
"hall"
id=
"hall"
class=
"form-control"
>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
<option
value=
"0"
>
0
</option>
<option
value=
"0"
>
0
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"2"
>
2
</option>
...
@@ -159,6 +163,7 @@
...
@@ -159,6 +163,7 @@
</select>
</select>
<label
for=
"hall"
>
厅
</label>
<label
for=
"hall"
>
厅
</label>
<select
name=
"bathroom"
id=
"bathroom"
class=
"form-control"
>
<select
name=
"bathroom"
id=
"bathroom"
class=
"form-control"
>
<option
value=
"不限"
selected=
"selected"
>
不限
</option>
<option
value=
"0"
>
0
</option>
<option
value=
"0"
>
0
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"2"
>
2
</option>
...
@@ -176,6 +181,7 @@
...
@@ -176,6 +181,7 @@
</div>
</div>
</div>
</div>
<br>
<br>
{% if role == 'administrator' or role == 'editor' %}
<table
class=
"form-table"
>
<table
class=
"form-table"
>
<tbody>
<tbody>
<tr>
<tr>
...
@@ -199,3 +205,6 @@
...
@@ -199,3 +205,6 @@
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
{% elseif role == 'author' %}
<input
type=
"hidden"
name=
"consultant_id"
value=
"{{ consultant_id }}"
>
{% endif %}
\ No newline at end of file
wp-content/plugins/tospur/Admin/views/customerList.html
View file @
5d92fe11
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<h2>
客户列表
</h2>
<h2>
客户列表
</h2>
<form
id=
"scores-filter"
method=
"post"
>
<form
id=
""
method=
"post"
>
<input
type=
"hidden"
name=
"page"
value=
"{{page}}"
/>
<div>
<select
id=
"listCity"
name=
"listCity"
>
<label
for=
"status"
class=
"hidden"
></label>
<option
value=
"0"
>
城市
</option>
<select
name=
"status"
id=
"status"
>
{% for item in city %}
<option
{{
item
.
id =
=
cityId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<select
id=
"listDistrict"
name=
"listDistrict"
>
<option
value=
"0"
>
区域
</option>
{% if district %}
{% for item in district %}
<option
{{
item
.
id =
=
districtId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
<select
id=
"listPlate"
name=
"listPlate"
>
<option
value=
"0"
>
板块
</option>
{% if plate %}
{% for item in plate %}
<option
{{
item
.
id =
=
plateId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
<select
id=
"totalPrice"
name=
"totalPrice"
>
<option
value =
""
>
价格
</option>
{% if dicTotalPrice %}
{% for item in dicTotalPrice %}
<option
{{
item
.
value =
=
totalPrice
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
<select
id=
"room"
name=
"room"
>
<option
value=
"0"
>
类型
</option>
{% for item in room %}
<option
{{
item
.
id =
=
roomId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<select
id=
"buildProperty"
name=
"buildProperty"
>
<option
value=
"0"
>
房型
</option>
{% for item in buildProperty %}
<option
{{
item
.
id =
=
buildPropertyId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<select
id=
"acreage"
name=
"acreage"
>
<option
value =
""
>
面积
</option>
{% if acreage %}
{% for item in dicArea %}
<option
{{
item
.
value =
=
acreage
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
<select
name=
"status"
name=
"status"
>
<option
value=
"-1"
>
状态
</option>
<option
value=
"-1"
>
状态
</option>
{% for item in status%}
{% for item in status %}
<option
{{
item
.
id =
=
statusId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
<option
{{
item
.
id =
=
status_id
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
<input
type=
"text"
placeholder=
"请出入楼盘名"
name=
"searchText"
>
<label
for=
"customer_type"
class=
"hidden"
></label>
<input
type=
"hidden"
name=
"hasSearch"
value=
"1"
/>
<select
name=
"customer_type"
id=
"customer_type"
>
<option
value=
"-1"
>
客户类型
</option>
{% for item in customer_type %}
<option
{{
item
.
id =
=
customer_type_id
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<label
for=
"demand_type"
class=
"hidden"
></label>
<select
name=
"demand_type"
id=
"demand_type"
>
<option
value=
"-1"
>
需求类型
</option>
<option
value=
"0"
>
新房
</option>
<option
value=
"1"
>
二手房
</option>
<option
value=
"2"
>
租房
</option>
</select>
<input
type=
"text"
placeholder=
"请输入姓名"
name=
"search_name"
value=
"{{ search_name }}"
>
<input
type=
"text"
placeholder=
"请输入置业顾问"
name=
"search_consultant_name"
value=
"{{ search_consultant_name }}"
>
<input
type=
"text"
placeholder=
"请输入电话"
name=
"search_phone"
value=
"{{ search_phone }}"
>
</div>
<div
style=
"margin-top: 10px;"
>
<span>
日期
</span>
<label
for=
"search_min_time"
class=
"hidden"
></label>
<input
type=
"date"
name=
"search_min_time"
id=
"search_min_time"
value=
"{{ search_min_time }}"
>
—
<label
for=
"search_max_time"
class=
"hidden"
></label>
<input
type=
"date"
name=
"search_max_time"
id=
"search_max_time"
value=
"{{ search_max_time }}"
>
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"搜索"
>
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"搜索"
>
<!-- Now we can render the completed list table -->
</div>
{{function("addCustomerTable")}}
{{ function("addCustomerTable") }}
<input
type=
"hidden"
name=
"paged"
value=
"1"
>
</form>
</form>
</div>
</div>
<script>
<script>
(
function
(
$
)
{
(
function
(
$
)
{
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
'#demand_type'
).
val
(
'{{ demand_type }}'
);
});
});
})(
jQuery
);
})(
jQuery
);
</script>
</script>
\ No newline at end of file
wp-content/plugins/tospur/Dao/CustomerDao.php
0 → 100644
View file @
5d92fe11
<?php
class
CustomerDao
{
public
static
function
insert_customer
(
$params
){
global
$wpdb
;
$result
=
$wpdb
->
insert
(
Config
::
TOSPUR_CUSTOMER_TABLE
,
$params
);
$insert_id
=
$wpdb
->
insert_id
;
if
(
$result
){
return
$insert_id
;
}
else
{
return
0
;
}
}
public
static
function
searchCustomer
(
$id
)
{
global
$wpdb
;
$sql
=
"SELECT tcs.* FROM tospur_customer tcs where tcs.id = %d"
;
$result
=
$wpdb
->
get_row
(
$wpdb
->
prepare
(
$sql
,
$id
));
$context
=
array
();
if
(
$result
){
$context
[
'result'
]
=
$result
;
$consultant_sql
=
"SELECT * FROM tospur_consultant where id = %d"
;
$consultant
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
$consultant_sql
,
$result
->
consultant_id
));
$context
[
'consultant'
]
=
$consultant
;
}
return
$context
;
}
}
?>
\ No newline at end of file
wp-content/plugins/tospur/Dao/InsertDao.php
View file @
5d92fe11
...
@@ -15,18 +15,6 @@ class InsertDao{
...
@@ -15,18 +15,6 @@ class InsertDao{
}
}
}
}
public
static
function
insert_customer
(
$params
){
global
$wpdb
;
$result
=
$wpdb
->
insert
(
Config
::
TOSPUR_CUSTOMER_TABLE
,
$params
);
print_r
(
$wpdb
->
last_query
);
$insert_id
=
$wpdb
->
insert_id
;
if
(
$result
){
return
$insert_id
;
}
else
{
return
0
;
}
}
public
static
function
setHouseNumber
(
$houseId
,
$houseType
,
$cityId
){
public
static
function
setHouseNumber
(
$houseId
,
$houseType
,
$cityId
){
global
$wpdb
;
global
$wpdb
;
switch
(
$houseType
){
switch
(
$houseType
){
...
...
wp-content/plugins/tospur/Dao/SearchDao.php
View file @
5d92fe11
...
@@ -418,21 +418,6 @@ class SearchDao
...
@@ -418,21 +418,6 @@ class SearchDao
return
$context
;
return
$context
;
}
}
public
static
function
searchCustomer
(
$id
)
{
global
$wpdb
;
$sql
=
"SELECT tcs.* FROM tospur_customer tcs where tcs.id = %d"
;
$result
=
$wpdb
->
get_row
(
$wpdb
->
prepare
(
$sql
,
$id
));
$context
=
array
();
if
(
$result
){
$context
[
'result'
]
=
$result
;
$consultant_sql
=
"SELECT * FROM tospur_consultant where id = %d"
;
$consultant
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
$consultant_sql
,
$result
->
consultant_id
));
$context
[
'consultant'
]
=
$consultant
;
}
return
$context
;
}
public
static
function
searchHouseTag
(
$houseId
){
public
static
function
searchHouseTag
(
$houseId
){
global
$wpdb
;
global
$wpdb
;
$sql
=
"select tt.name from a_house_tag aht
$sql
=
"select tt.name from a_house_tag aht
...
...
wp-content/plugins/tospur/index.php
View file @
5d92fe11
...
@@ -18,6 +18,7 @@ function tospur_init()
...
@@ -18,6 +18,7 @@ function tospur_init()
require_once
(
PLUGIN_DIR
.
'Dao/SearchDao.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/SearchDao.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/TospurDao.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/TospurDao.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/CustomerTrackingDao.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/CustomerTrackingDao.php'
);
require_once
(
PLUGIN_DIR
.
'Dao/CustomerDao.php'
);
require_once
(
PLUGIN_DIR
.
'Admin/House.php'
);
require_once
(
PLUGIN_DIR
.
'Admin/House.php'
);
require_once
(
PLUGIN_DIR
.
'Admin/newHouseList.php'
);
require_once
(
PLUGIN_DIR
.
'Admin/newHouseList.php'
);
require_once
(
PLUGIN_DIR
.
'Admin/secHandHouse.php'
);
require_once
(
PLUGIN_DIR
.
'Admin/secHandHouse.php'
);
...
@@ -162,17 +163,17 @@ function update_consultant()
...
@@ -162,17 +163,17 @@ 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
(
'nesHouseList'
,
'新房列表'
,
'
moderate_commen
ts'
,
'newHouseList'
,
'function_newHouseList'
,
'dashicons-menu'
,
6
);
add_menu_page
(
'nesHouseList'
,
'新房列表'
,
'
edit_published_pos
ts'
,
'newHouseList'
,
'function_newHouseList'
,
'dashicons-menu'
,
6
);
add_submenu_page
(
'newHouseList'
,
'添加新房'
,
'添加新房'
,
'
moderate_commen
ts'
,
'newHouse'
,
'House::init_view'
);
add_submenu_page
(
'newHouseList'
,
'添加新房'
,
'添加新房'
,
'
edit_published_pos
ts'
,
'newHouse'
,
'House::init_view'
);
add_menu_page
(
'secHandHouseList'
,
'二手房列表'
,
'
moderate_commen
ts'
,
'secHandHouseList'
,
'function_secHandHouseList'
,
'dashicons-menu'
,
7
);
add_menu_page
(
'secHandHouseList'
,
'二手房列表'
,
'
edit_published_pos
ts'
,
'secHandHouseList'
,
'function_secHandHouseList'
,
'dashicons-menu'
,
7
);
add_submenu_page
(
'secHandHouseList'
,
'添加二手房'
,
'添加二手房'
,
'
moderate_commen
ts'
,
'secHandHouse'
,
'SecHandHouse::secHandHouse_html'
);
add_submenu_page
(
'secHandHouseList'
,
'添加二手房'
,
'添加二手房'
,
'
edit_published_pos
ts'
,
'secHandHouse'
,
'SecHandHouse::secHandHouse_html'
);
add_submenu_page
(
'secHandHouseList'
,
'添加特色'
,
'添加特色'
,
'
moderate_commen
ts'
,
'add_feature'
,
'feature::add_feature_html'
);
add_submenu_page
(
'secHandHouseList'
,
'添加特色'
,
'添加特色'
,
'
edit_published_pos
ts'
,
'add_feature'
,
'feature::add_feature_html'
);
add_menu_page
(
'rentHouseList'
,
'租房列表'
,
'
moderate_commen
ts'
,
'rentHouseList'
,
'function_rentHouseList'
,
'dashicons-menu'
,
8
);
add_menu_page
(
'rentHouseList'
,
'租房列表'
,
'
edit_published_pos
ts'
,
'rentHouseList'
,
'function_rentHouseList'
,
'dashicons-menu'
,
8
);
add_submenu_page
(
'rentHouseList'
,
'添加租房'
,
'添加租房'
,
'
moderate_commen
ts'
,
'rentHouse'
,
'RentHouse::rentHouse_html'
);
add_submenu_page
(
'rentHouseList'
,
'添加租房'
,
'添加租房'
,
'
edit_published_pos
ts'
,
'rentHouse'
,
'RentHouse::rentHouse_html'
);
add_menu_page
(
"introduction"
,
"诚信宣言"
,
"editor"
,
"introduction"
,
"introduction::introduction_html"
,
'dashicons-menu'
,
9
);
add_menu_page
(
"introduction"
,
"诚信宣言"
,
"editor"
,
"introduction"
,
"introduction::introduction_html"
,
'dashicons-menu'
,
9
);
add_menu_page
(
'contract'
,
'合同管理'
,
'
moderate_commen
ts'
,
'contract'
,
'Contract::init_view'
,
'dashicons-menu'
,
10
);
add_menu_page
(
'contract'
,
'合同管理'
,
'
edit_published_pos
ts'
,
'contract'
,
'Contract::init_view'
,
'dashicons-menu'
,
10
);
add_menu_page
(
'客户列表'
,
'客户列表'
,
'
moderate_commen
ts'
,
'customerList'
,
'function_customerList'
,
'dashicons-menu'
,
11
);
add_menu_page
(
'客户列表'
,
'客户列表'
,
'
edit_published_pos
ts'
,
'customerList'
,
'function_customerList'
,
'dashicons-menu'
,
11
);
add_submenu_page
(
'customerList'
,
'新增客户'
,
'新增客户'
,
'
moderate_commen
ts'
,
'customer'
,
'customer::customer_html'
);
add_submenu_page
(
'customerList'
,
'新增客户'
,
'新增客户'
,
'
edit_published_pos
ts'
,
'customer'
,
'customer::customer_html'
);
//移除更新信息
//移除更新信息
remove_action
(
'admin_notices'
,
'update_nag'
,
3
);
remove_action
(
'admin_notices'
,
'update_nag'
,
3
);
global
$menu
;
global
$menu
;
...
...
wp-content/themes/tospur/functions.php
View file @
5d92fe11
...
@@ -264,7 +264,7 @@ function user_redirect($user)
...
@@ -264,7 +264,7 @@ function user_redirect($user)
$url
=
null
;
$url
=
null
;
if
(
$user
->
ID
>
0
)
{
if
(
$user
->
ID
>
0
)
{
$role
=
$user
->
roles
[
0
];
$role
=
$user
->
roles
[
0
];
if
(
$role
==
'administrator'
||
$role
==
'editor'
)
{
if
(
$role
==
'administrator'
||
$role
==
'editor'
||
$role
==
'author'
)
{
$url
=
admin_url
(
'admin.php?page=newHouseList'
);
$url
=
admin_url
(
'admin.php?page=newHouseList'
);
}
else
{
}
else
{
$url
=
site_url
();
$url
=
site_url
();
...
...
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