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
102311c9
Commit
102311c9
authored
Sep 24, 2015
by
felix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每日一更
parent
974ac51a
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1096 additions
and
768 deletions
+1096
-768
wp-content/plugins/tospur/Admin/Contract.php
+22
-19
wp-content/plugins/tospur/Admin/Contract_List.php
+2
-2
wp-content/plugins/tospur/Admin/House.php
+33
-5
wp-content/plugins/tospur/Admin/Tospur_House.php
+5
-0
wp-content/plugins/tospur/Admin/commissionList.php
+2
-2
wp-content/plugins/tospur/Admin/consultant_score.php
+0
-7
wp-content/plugins/tospur/Admin/customerList.php
+232
-253
wp-content/plugins/tospur/Admin/customerTrackingList.php
+116
-111
wp-content/plugins/tospur/Admin/introduction.php
+10
-6
wp-content/plugins/tospur/Admin/newHouseList.php
+25
-10
wp-content/plugins/tospur/Admin/rentHouse.php
+35
-5
wp-content/plugins/tospur/Admin/rentHouseList.php
+10
-12
wp-content/plugins/tospur/Admin/secHandHouse.php
+33
-3
wp-content/plugins/tospur/Admin/secHandHouseList.php
+9
-11
wp-content/plugins/tospur/Admin/tospur_sale.php
+8
-13
wp-content/plugins/tospur/Admin/tospur_sale_detail.php
+39
-8
wp-content/plugins/tospur/Admin/view_house.php
+0
-7
wp-content/plugins/tospur/Admin/views/contract.html
+14
-0
wp-content/plugins/tospur/Admin/views/introduction.html
+25
-18
wp-content/plugins/tospur/Admin/views/listBlock.html
+88
-84
wp-content/plugins/tospur/Admin/views/newhouse.html
+21
-7
wp-content/plugins/tospur/Admin/views/rentHouse.html
+19
-8
wp-content/plugins/tospur/Admin/views/sale_detail.html
+84
-82
wp-content/plugins/tospur/Admin/views/secHandHouse.html
+15
-5
wp-content/plugins/tospur/Admin/views/selectOrganization.html
+1
-1
wp-content/plugins/tospur/Dao/CustomerDao.php
+13
-0
wp-content/plugins/tospur/Dao/InsertDao.php
+56
-56
wp-content/plugins/tospur/Dao/SearchDao.php
+1
-1
wp-content/plugins/tospur/Dao/TospurDao.php
+0
-1
wp-content/plugins/tospur/Tools/Core.php
+26
-0
wp-content/plugins/tospur/Tools/TCSync.php
+3
-2
wp-content/plugins/tospur/index.php
+134
-19
wp-content/themes/tospur/functions.php
+9
-4
wp-content/themes/tospur/js/public.js
+1
-1
wp-content/themes/tospur/list.php
+1
-1
wp-content/themes/tospur/my.php
+1
-3
wp-content/themes/tospur/views/index.html
+3
-1
No files found.
wp-content/plugins/tospur/Admin/Contract.php
View file @
102311c9
...
@@ -12,7 +12,7 @@ class Contract {
...
@@ -12,7 +12,7 @@ class Contract {
$context
[
'siteUrl'
]
=
get_site_url
();
$context
[
'siteUrl'
]
=
get_site_url
();
$context
[
'adminUrl'
]
=
admin_url
();
$context
[
'adminUrl'
]
=
admin_url
();
$context
[
'city'
]
=
SearchDao
::
searchCity
();
$context
[
'city'
]
=
SearchDao
::
searchCity
();
$context
[
'managers'
]
=
get_users
(
'role=
editor
'
);
$context
[
'managers'
]
=
get_users
(
'role=
jl
'
);
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
4
);
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
4
);
$context
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
$context
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
$context
[
'room'
]
=
SearchDao
::
searchRoom
();
$context
[
'room'
]
=
SearchDao
::
searchRoom
();
...
@@ -48,6 +48,18 @@ class Contract {
...
@@ -48,6 +48,18 @@ class Contract {
Timber
::
render
(
"contract.html"
,
$context
);
Timber
::
render
(
"contract.html"
,
$context
);
}
}
private
static
function
formatCommissionParams
(
$params
,
$contractId
,
$type
){
$commissionParams
=
array
(
"accounts"
=>
$params
[
"accounts"
],
"type"
=>
$_REQUEST
[
"businessType"
],
"contractId"
=>
$contractId
,
"consultantId"
=>
$params
[
"consultantId"
],
"ioType"
=>
$type
,
"mtime"
=>
$params
[
"mtime"
]
);
return
$commissionParams
;
}
private
static
function
doSqlAction
(){
private
static
function
doSqlAction
(){
$params
=
array
(
$params
=
array
(
'signedDate'
=>
$_REQUEST
[
'signedDate'
],
'signedDate'
=>
$_REQUEST
[
'signedDate'
],
...
@@ -77,10 +89,15 @@ class Contract {
...
@@ -77,10 +89,15 @@ class Contract {
return
$result
;
return
$result
;
}
}
$status
=
0
;
$status
=
0
;
if
(
$params
[
'status'
]
==
4
)
{
if
(
$params
[
'status'
]
==
4
)
{
//作废
$status
=
0
;
$status
=
0
;
}
else
if
(
$params
[
'status'
]
==
3
){
}
else
if
(
$params
[
'status'
]
==
3
){
//成交
$status
=
2
;
$status
=
2
;
$result
=
CustomerDao
::
updateCustomerStatue
(
$_REQUEST
[
'customerNumber'
],
1
);
if
(
!
is_numeric
(
$result
)){
return
$result
;
}
}
}
$result
=
HouseDao
::
updateStatus
(
$status
,
$_REQUEST
[
'id'
]);
$result
=
HouseDao
::
updateStatus
(
$status
,
$_REQUEST
[
'id'
]);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
...
@@ -121,28 +138,14 @@ class Contract {
...
@@ -121,28 +138,14 @@ class Contract {
return
$result
;
return
$result
;
}
}
}
}
$buyCommission
=
$_REQUEST
[
'buy'
];
$buyCommissionParams
=
Contract
::
formatCommissionParams
(
$_REQUEST
[
'buy'
],
$contractId
,
0
);
$buyCommissionParams
=
array
(
"accounts"
=>
$buyCommission
[
"accounts"
],
"type"
=>
$_REQUEST
[
"businessType"
],
"contractId"
=>
$contractId
,
"consultantId"
=>
$buyCommission
[
"consultantId"
],
"ioType"
=>
0
);
$result
=
CommissionDao
::
insert_touspur_commission
(
$buyCommissionParams
);
$result
=
CommissionDao
::
insert_touspur_commission
(
$buyCommissionParams
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
return
$result
;
return
$result
;
}
}
$commissionType
[
'buy'
]
=
$result
;
$commissionType
[
'buy'
]
=
$result
;
$sellCommission
=
$_REQUEST
[
'sell'
];
$sellCommissionParams
=
Contract
::
formatCommissionParams
(
$_REQUEST
[
'sell'
],
$contractId
,
1
);
$sellCommissionParams
=
array
(
"accounts"
=>
$sellCommission
[
"accounts"
],
"type"
=>
$_REQUEST
[
"businessType"
],
"contractId"
=>
$contractId
,
"consultantId"
=>
$sellCommission
[
"consultantId"
],
"ioType"
=>
1
);
$result
=
CommissionDao
::
insert_touspur_commission
(
$sellCommissionParams
);
$result
=
CommissionDao
::
insert_touspur_commission
(
$sellCommissionParams
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
return
$result
;
return
$result
;
...
...
wp-content/plugins/tospur/Admin/Contract_List.php
View file @
102311c9
...
@@ -93,9 +93,9 @@ class Contract_List extends WP_List_Table{
...
@@ -93,9 +93,9 @@ class Contract_List extends WP_List_Table{
left join tospur_status ts on ts.status_type = 4 and t.status = ts.status_id
left join tospur_status ts on ts.status_type = 4 and t.status = ts.status_id
where 1=1 "
;
where 1=1 "
;
//置业顾问显示自己的合同
//置业顾问显示自己的合同
if
(
current_user_can
(
"
author
"
)){
if
(
current_user_can
(
"
zygw
"
)){
$sql
.=
" and t.consultantId = "
.
get_current_user_id
();
$sql
.=
" and t.consultantId = "
.
get_current_user_id
();
}
else
if
(
current_user_can
(
"editor
"
)){
//经理显示提交给自己的合同,和自己的合同
}
else
if
(
current_user_can
(
"htApproval
"
)){
//经理显示提交给自己的合同,和自己的合同
$sql
.=
" and (t.consultantId = "
.
get_current_user_id
()
.
" or t.managerId = "
.
get_current_user_id
()
.
")"
;
$sql
.=
" and (t.consultantId = "
.
get_current_user_id
()
.
" or t.managerId = "
.
get_current_user_id
()
.
")"
;
}
}
$sql
.=
" order by t.signedDate desc"
;
$sql
.=
" order by t.signedDate desc"
;
...
...
wp-content/plugins/tospur/Admin/House.php
View file @
102311c9
...
@@ -35,11 +35,38 @@ class House extends Tospur_House{
...
@@ -35,11 +35,38 @@ class House extends Tospur_House{
'room_id'
=>
$_POST
[
'baseRoom'
],
'room_id'
=>
$_POST
[
'baseRoom'
],
"location"
=>
$_POST
[
"location"
],
"location"
=>
$_POST
[
"location"
],
"property_money"
=>
$_POST
[
"property_money"
],
"property_money"
=>
$_POST
[
"property_money"
],
'community_name'
=>
$_POST
[
"community_name"
],
'community_name'
=>
$_POST
[
"community_name"
]
'status'
=>
$_POST
[
"status"
]
);
);
$wpdb
->
query
(
"START TRANSACTION"
);
$wpdb
->
query
(
"START TRANSACTION"
);
if
(
isset
(
$_POST
[
'houseId'
])){
if
(
isset
(
$_POST
[
'houseId'
])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if
(
$_POST
[
"userType"
]
==
0
){
//经理
//通过
if
(
$_POST
[
"status"
]
!=
-
2
){
$insert_tospur_house_array
[
"status"
]
=
$_POST
[
"status"
];
$insert_tospur_house_array
[
"approval"
]
=
-
2
;
}
else
{
//退回
$insert_tospur_house_array
[
"approval"
]
=
$_POST
[
"status"
];
}
}
else
{
//置业顾问
$currentStatus
=
SearchDao
::
getDetailInfo
(
$_POST
[
"userType"
]);
//修改了状态
if
(
$currentStatus
[
"result"
]
->
status
!=
$_POST
[
"status"
]){
$insert_tospur_house_array
[
"approval"
]
=
$_POST
[
"status"
];
}
else
{
//没有修改状态
//没有申请审批
if
(
$currentStatus
[
"result"
]
->
approval
==
-
2
){
$insert_tospur_house_array
[
"approval"
]
=
$currentStatus
[
"result"
]
->
status
;
}
else
{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array
[
"approval"
]
=
$currentStatus
[
"result"
]
->
approval
;
}
}
}
$result
=
House
::
data_update
(
$_POST
[
'houseId'
],
$insert_tospur_house_array
);
$result
=
House
::
data_update
(
$_POST
[
'houseId'
],
$insert_tospur_house_array
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
...
@@ -50,10 +77,12 @@ class House extends Tospur_House{
...
@@ -50,10 +77,12 @@ class House extends Tospur_House{
echo
"新房房源修改成功"
;
echo
"新房房源修改成功"
;
}
}
}
else
{
}
else
{
$insert_tospur_house_array
[
"status"
]
=
0
;
$insert_tospur_house_array
[
"approval"
]
=
1
;
$result
=
House
::
data_insert
(
$insert_tospur_house_array
);
$result
=
House
::
data_insert
(
$insert_tospur_house_array
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
print_r
(
$result
);
;
print_r
(
$result
);
echo
"新增房源失败"
;
echo
"新增房源失败"
;
}
else
{
}
else
{
$wpdb
->
query
(
"COMMIT"
);
$wpdb
->
query
(
"COMMIT"
);
...
@@ -69,7 +98,7 @@ class House extends Tospur_House{
...
@@ -69,7 +98,7 @@ class House extends Tospur_House{
$context
[
"mark"
]
=
SearchDao
::
searchHouseTag
(
$_GET
[
'id'
]);
$context
[
"mark"
]
=
SearchDao
::
searchHouseTag
(
$_GET
[
'id'
]);
$context
[
"status"
]
=
searchDao
::
searchStatusType
(
1
);
$context
[
"status"
]
=
searchDao
::
searchStatusType
(
1
);
}
}
$context
[
'
role'
]
=
House
::
getCurrentRole
();
$context
[
'
canApproval'
]
=
House
::
canApproval
();
$context
[
"city"
]
=
SearchDao
::
searchCity
();
$context
[
"city"
]
=
SearchDao
::
searchCity
();
$context
[
"buildProperty"
]
=
SearchDao
::
searchBuildProperty
();
$context
[
"buildProperty"
]
=
SearchDao
::
searchBuildProperty
();
$context
[
"room"
]
=
SearchDao
::
searchRoom
();
$context
[
"room"
]
=
SearchDao
::
searchRoom
();
...
@@ -133,7 +162,6 @@ class House extends Tospur_House{
...
@@ -133,7 +162,6 @@ class House extends Tospur_House{
InsertDao
::
addHouseTag
(
$houseId
,
$data
[
'houseTag'
]);
InsertDao
::
addHouseTag
(
$houseId
,
$data
[
'houseTag'
]);
CustomerTrackingDao
::
insert
(
$houseId
,
$_REQUEST
);
CustomerTrackingDao
::
insert
(
$houseId
,
$_REQUEST
);
return
$result
;
return
$result
;
}
}
...
...
wp-content/plugins/tospur/Admin/Tospur_House.php
View file @
102311c9
<?php
<?php
class
Tospur_House
{
class
Tospur_House
{
public
static
function
canApproval
(){
return
current_user_can
(
"houseApproval"
);
}
public
static
function
getCurrentRole
(){
public
static
function
getCurrentRole
(){
$current_user
=
wp_get_current_user
();
$current_user
=
wp_get_current_user
();
if
(
!
(
$current_user
instanceof
WP_User
)
)
if
(
!
(
$current_user
instanceof
WP_User
)
)
...
...
wp-content/plugins/tospur/Admin/commissionList.php
View file @
102311c9
...
@@ -125,12 +125,12 @@ class commissionList extends WP_List_Table
...
@@ -125,12 +125,12 @@ class commissionList extends WP_List_Table
$achieving_rate
=
0
;
$achieving_rate
=
0
;
if
(
$value
->
target_amount
)
{
if
(
$value
->
target_amount
)
{
$target_amount
=
$value
->
target_amount
;
$target_amount
=
$value
->
target_amount
;
$achieving_rate
=
round
(((
$value
->
paid
)
/
$target_amount
/
10000
)
,
2
);
$achieving_rate
=
round
(((
$value
->
paid
)
/
$target_amount
)
*
100
,
2
);
}
}
$data
[
$key
]
=
array
(
$data
[
$key
]
=
array
(
'organization_name'
=>
$value
->
organization_name
,
'organization_name'
=>
$value
->
organization_name
,
'consultant_name'
=>
$value
->
consultant_name
,
'consultant_name'
=>
$value
->
consultant_name
,
'target_amount'
=>
$target_amount
,
'target_amount'
=>
round
(
$target_amount
/
10000
,
2
)
,
'achieving_rate'
=>
$achieving_rate
.
'%'
,
'achieving_rate'
=>
$achieving_rate
.
'%'
,
'business'
=>
round
(
$value
->
business
/
10000
,
2
),
'business'
=>
round
(
$value
->
business
/
10000
,
2
),
'lease'
=>
round
(
$value
->
lease
/
10000
,
2
),
'lease'
=>
round
(
$value
->
lease
/
10000
,
2
),
...
...
wp-content/plugins/tospur/Admin/consultant_score.php
View file @
102311c9
...
@@ -173,13 +173,6 @@ class consultantScoreList extends WP_List_Table
...
@@ -173,13 +173,6 @@ class consultantScoreList extends WP_List_Table
}
}
}
}
function
add_consultant_score_menu
()
{
add_menu_page
(
'置业顾问评分'
,
'置业顾问评分'
,
'moderate_comments'
,
'consultant_score'
,
'consultant_score_page'
,
'dashicons-menu'
,
26
);
}
function
consultant_score_page
()
function
consultant_score_page
()
{
{
$consultantScoreList
=
new
consultantScoreList
();
$consultantScoreList
=
new
consultantScoreList
();
...
...
wp-content/plugins/tospur/Admin/customerList.php
View file @
102311c9
<?php
<?php
if
(
!
class_exists
(
'WP_List_Table'
))
{
if
(
!
class_exists
(
'WP_List_Table'
))
{
require_once
(
ABSPATH
.
'wp-admin/includes/class-wp-list-table.php'
);
require_once
(
ABSPATH
.
'wp-admin/includes/class-wp-list-table.php'
);
}
}
class
customerList
extends
WP_List_Table
class
customerList
extends
WP_List_Table
{
{
function
__construct
()
function
__construct
()
{
{
parent
::
__construct
(
array
(
parent
::
__construct
(
array
(
'singular'
=>
'customerList'
,
'singular'
=>
'customerList'
,
'plural'
=>
'customerList'
,
'plural'
=>
'customerList'
,
'ajax'
=>
false
'ajax'
=>
false
));
));
}
}
function
column_default
(
$item
,
$column_name
)
function
column_default
(
$item
,
$column_name
)
{
{
switch
(
$column_name
)
{
switch
(
$column_name
)
{
case
'name'
:
case
'name'
:
return
'<a href="'
.
admin_url
(
'admin.php?page=customer&edit=true&id='
.
$item
[
'id'
])
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
return
'<a href="'
.
admin_url
(
'admin.php?page=customer&edit=true&id='
.
$item
[
'id'
])
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
default
:
default
:
return
$item
[
$column_name
];
return
$item
[
$column_name
];
}
}
}
}
function
column_cb
(
$item
)
function
column_cb
(
$item
)
{
{
return
sprintf
(
return
sprintf
(
'<input type="checkbox" name="%1$s[]" value="%2$s" data-consultant="%3$s"/>'
,
'<input type="checkbox" name="%1$s[]" value="%2$s" data-consultant="%3$s"/>'
,
$this
->
_args
[
'singular'
],
$this
->
_args
[
'singular'
],
$item
[
'id'
],
$item
[
'id'
],
$item
[
'consultant_id'
]
$item
[
'consultant_id'
]
);
);
}
}
function
get_columns
()
function
get_columns
()
{
{
$columns
=
array
(
$columns
=
array
(
'cb'
=>
'<input type="checkbox"/>'
'cb'
=>
'<input type="checkbox"/>'
);
);
$columns
[
'name'
]
=
'姓名'
;
$columns
[
'name'
]
=
'姓名'
;
$columns
[
'demand_type'
]
=
'需求类型'
;
$columns
[
'demand_type'
]
=
'需求类型'
;
$columns
[
'consultant_name'
]
=
'置业顾问'
;
$columns
[
'consultant_name'
]
=
'置业顾问'
;
$columns
[
'status_name'
]
=
'状态'
;
$columns
[
'status_name'
]
=
'状态'
;
$columns
[
'customer_remark'
]
=
'客户备注'
;
$columns
[
'customer_remark'
]
=
'客户备注'
;
return
$columns
;
return
$columns
;
}
}
function
get_bulk_actions
()
function
get_bulk_actions
()
{
{
$actions
=
array
(
$actions
=
array
(
'allot'
=>
'分配置业顾问'
'allot'
=>
'分配置业顾问'
);
);
return
$actions
;
return
$actions
;
}
}
function
process_bulk_action
()
function
process_bulk_action
()
{
{
$action
=
$this
->
current_action
();
$action
=
$this
->
current_action
();
if
(
$action
)
{
if
(
$action
)
{
$string
=
null
;
$string
=
null
;
switch
(
$action
)
{
switch
(
$action
)
{
case
'allot'
:
case
'allot'
:
$consultant_id
=
$_POST
[
'allot_consultant_id'
];
$consultant_id
=
$_POST
[
'allot_consultant_id'
];
if
(
$consultant_id
)
{
if
(
$consultant_id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$_POST
[
'customerlist'
]))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$_POST
[
'customerlist'
]))
.
')'
;
global
$wpdb
;
global
$wpdb
;
$result
=
$wpdb
->
query
(
'update '
.
Config
::
TOSPUR_CUSTOMER_TABLE
$result
=
$wpdb
->
query
(
'update '
.
Config
::
TOSPUR_CUSTOMER_TABLE
.
' SET consultant_id = '
.
$consultant_id
.
' SET consultant_id = '
.
$consultant_id
.
' where id in '
.
$string
);
.
' where id in '
.
$string
);
if
(
$result
){
if
(
$result
){
echo
'<script>alert("分配置业顾问成功");</script>'
;
echo
'<script>alert("分配置业顾问成功");</script>'
;
}
}
}
}
break
;
break
;
}
}
}
}
}
}
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
();
$this
->
_column_headers
=
array
(
$columns
,
$hidden
);
$this
->
_column_headers
=
array
(
$columns
,
$hidden
);
$this
->
process_bulk_action
();
$this
->
process_bulk_action
();
$sql
=
"SELECT tcs.*,tc.name as consultant_name,ts.status_name FROM tospur_customer tcs"
.
$sql
=
"SELECT tcs.*,tc.name as consultant_name,ts.status_name,tc.subsidiaryId FROM tospur_customer tcs"
.
" left join (SELECT * FROM tospur_status where status_type = 5) as ts on tcs.status = ts.status_id"
.
" 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"
;
" left join tospur_consultant tc on tcs.consultant_id = tc.id"
.
$current_user
=
wp_get_current_user
();
" left join tospur_organization torg on tc.subsidiaryId = torg.id"
.
if
(
$current_user
->
roles
[
0
]
==
'author'
){
" where 1 = 1"
;
$sql
=
$sql
.
" and tcs.consultant_id = "
.
$current_user
->
ID
;
if
(
current_user_can
(
'zygw'
))
{
}
$sql
=
$sql
.
" and tcs.consultant_id = "
.
get_current_user_id
();
if
(
isset
(
$_REQUEST
[
'status'
])
&&
$_REQUEST
[
'status'
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.status = "
.
$_REQUEST
[
'status'
];
if
(
isset
(
$_REQUEST
[
'organization'
])
&&
$_REQUEST
[
'organization'
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tc.subsidiaryId = "
.
$_REQUEST
[
'organization'
];
if
(
isset
(
$_REQUEST
[
'customer_type'
])
&&
$_REQUEST
[
'customer_type'
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.customer_type = "
.
$_REQUEST
[
'customer_type'
];
if
(
isset
(
$_REQUEST
[
'status'
])
&&
$_REQUEST
[
'status'
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.status = "
.
$_REQUEST
[
'status'
];
if
(
isset
(
$_REQUEST
[
'demand_type'
])
&&
$_REQUEST
[
'demand_type'
]
!=
-
1
)
{
}
$demand_type
=
null
;
if
(
isset
(
$_REQUEST
[
'customer_type'
])
&&
$_REQUEST
[
'customer_type'
]
!=
-
1
)
{
switch
(
$_REQUEST
[
'demand_type'
])
{
$sql
=
$sql
.
" and tcs.customer_type = "
.
$_REQUEST
[
'customer_type'
];
case
0
:
}
$demand_type
=
'tcs.new_house'
;
if
(
isset
(
$_REQUEST
[
'demand_type'
])
&&
$_REQUEST
[
'demand_type'
]
!=
-
1
)
{
break
;
$demand_type
=
null
;
case
1
:
switch
(
$_REQUEST
[
'demand_type'
])
{
$demand_type
=
'tcs.secondHand_house'
;
case
0
:
break
;
$demand_type
=
'tcs.new_house'
;
case
2
:
break
;
$demand_type
=
'tcs.rent_house'
;
case
1
:
break
;
$demand_type
=
'tcs.secondHand_house'
;
}
break
;
if
(
$demand_type
)
{
case
2
:
$sql
=
$sql
.
" and "
.
$demand_type
.
" = 1"
;
$demand_type
=
'tcs.rent_house'
;
}
break
;
}
}
if
(
isset
(
$_REQUEST
[
'listCity'
])
&&
$_REQUEST
[
"listCity"
]
!=
-
1
)
{
if
(
$demand_type
)
{
$sql
=
$sql
.
" and tcs.city_id = "
.
$_REQUEST
[
"listCity"
];
$sql
=
$sql
.
" and "
.
$demand_type
.
" = 1"
;
}
}
if
(
isset
(
$_REQUEST
[
'listDistrict'
])
&&
$_REQUEST
[
"listDistrict"
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.district_id = "
.
$_REQUEST
[
"listDistrict"
];
if
(
isset
(
$_REQUEST
[
'listCity'
])
&&
$_REQUEST
[
"listCity"
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.city_id = "
.
$_REQUEST
[
"listCity"
];
if
(
isset
(
$_REQUEST
[
'listPlate'
])
&&
$_REQUEST
[
"listPlate"
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.plate_id = "
.
$_REQUEST
[
"listPlate"
];
if
(
isset
(
$_REQUEST
[
'listDistrict'
])
&&
$_REQUEST
[
"listDistrict"
]
!=
-
1
)
{
}
$sql
=
$sql
.
" and tcs.district_id = "
.
$_REQUEST
[
"listDistrict"
];
if
(
$_REQUEST
[
"totalPrice"
]
!=
null
)
{
}
$priceArray
=
explode
(
"-"
,
$_REQUEST
[
'totalPrice'
]);
if
(
isset
(
$_REQUEST
[
'listPlate'
])
&&
$_REQUEST
[
"listPlate"
]
!=
-
1
)
{
$sql
=
$sql
.
" and (tcs.min_totalPrice >= "
.
$priceArray
[
0
]
.
" and tcs.max_totalPrice <= "
.
$priceArray
[
1
]
.
")"
;
$sql
=
$sql
.
" and tcs.plate_id = "
.
$_REQUEST
[
"listPlate"
];
}
}
if
(
$_REQUEST
[
"rentalPrice"
]
!=
null
)
{
if
(
isset
(
$_REQUEST
[
'totalPrice'
])
&&
$_REQUEST
[
"totalPrice"
]
!=
-
1
)
{
$priceArray
=
explode
(
"-"
,
$_REQUEST
[
'rentalPrice'
]);
$priceArray
=
explode
(
"-"
,
$_REQUEST
[
'totalPrice'
]);
$sql
=
$sql
.
" and (tcs.min_rent >= "
.
$priceArray
[
0
]
.
" and tcs.max_rent <= "
.
$priceArray
[
1
]
.
")"
;
$sql
=
$sql
.
" and (tcs.min_totalPrice >= "
.
$priceArray
[
0
]
.
" and tcs.max_totalPrice <= "
.
$priceArray
[
1
]
.
")"
;
}
}
if
(
isset
(
$_REQUEST
[
'buildProperty'
])
&&
$_REQUEST
[
"buildProperty"
]
!=
-
1
)
{
if
(
isset
(
$_REQUEST
[
'rentalPrice'
])
&&
$_REQUEST
[
"rentalPrice"
]
!=
-
1
)
{
if
(
$_REQUEST
[
"buildProperty"
]
==
5
)
{
$priceArray
=
explode
(
"-"
,
$_REQUEST
[
'rentalPrice'
]);
$sql
=
$sql
.
" and (tcs.bedroom >= "
.
$_REQUEST
[
"buildProperty"
]
.
" or tcs.bedroom = -1)"
;
$sql
=
$sql
.
" and (tcs.min_rent >= "
.
$priceArray
[
0
]
.
" and tcs.max_rent <= "
.
$priceArray
[
1
]
.
")"
;
}
else
{
}
$sql
=
$sql
.
" and (tcs.bedroom = "
.
$_REQUEST
[
"buildProperty"
]
.
" or tcs.bedroom = -1)"
;
if
(
isset
(
$_REQUEST
[
'buildProperty'
])
&&
$_REQUEST
[
"buildProperty"
]
!=
-
1
)
{
}
if
(
$_REQUEST
[
"buildProperty"
]
==
5
)
{
}
$sql
=
$sql
.
" and (tcs.bedroom >= "
.
$_REQUEST
[
"buildProperty"
]
.
" or tcs.bedroom = -1)"
;
if
(
$_REQUEST
[
"acreage"
]
!=
null
)
{
}
else
{
$areaArray
=
explode
(
"-"
,
$_REQUEST
[
'acreage'
]);
$sql
=
$sql
.
" and (tcs.bedroom = "
.
$_REQUEST
[
"buildProperty"
]
.
" or tcs.bedroom = -1)"
;
$sql
=
$sql
.
" and (tcs.min_coveredArea >= "
.
$areaArray
[
0
]
.
" and tcs.max_coveredArea <= "
.
$areaArray
[
1
]
.
")"
;
}
}
}
if
(
isset
(
$_REQUEST
[
'search_name'
]))
{
if
(
isset
(
$_REQUEST
[
'acreage'
])
&&
$_REQUEST
[
"acreage"
]
!=
-
1
)
{
$sql
=
$sql
.
" and tcs.name like '%"
.
$_REQUEST
[
'search_name'
]
.
"%'"
;
$areaArray
=
explode
(
"-"
,
$_REQUEST
[
'acreage'
]);
}
$sql
=
$sql
.
" and (tcs.min_coveredArea >= "
.
$areaArray
[
0
]
.
" and tcs.max_coveredArea <= "
.
$areaArray
[
1
]
.
")"
;
if
(
isset
(
$_REQUEST
[
'search_consultant_name'
]))
{
}
$sql
=
$sql
.
" and tc.name like '%"
.
$_REQUEST
[
'search_consultant_name'
]
.
"%'"
;
if
(
isset
(
$_REQUEST
[
'search_name'
]))
{
}
$sql
=
$sql
.
" and tcs.name like '%"
.
$_REQUEST
[
'search_name'
]
.
"%'"
;
if
(
isset
(
$_REQUEST
[
'search_phone'
]))
{
}
$sql
=
$sql
.
" and tcs.phone like '%"
.
$_REQUEST
[
'search_phone'
]
.
"%'"
;
if
(
isset
(
$_REQUEST
[
'search_consultant_name'
]))
{
}
$sql
=
$sql
.
" and tc.name like '%"
.
$_REQUEST
[
'search_consultant_name'
]
.
"%'"
;
if
(
isset
(
$_REQUEST
[
'search_min_time'
])
&&
$_REQUEST
[
'search_min_time'
]
!=
null
)
{
}
$sql
=
$sql
.
" and tcs.time >= '"
.
$_REQUEST
[
'search_min_time'
]
.
"'"
;
if
(
isset
(
$_REQUEST
[
'search_phone'
]))
{
}
$sql
=
$sql
.
" and tcs.phone like '%"
.
$_REQUEST
[
'search_phone'
]
.
"%'"
;
if
(
isset
(
$_REQUEST
[
'search_max_time'
])
&&
$_REQUEST
[
'search_max_time'
]
!=
null
)
{
}
$sql
=
$sql
.
" and tcs.time <= '"
.
$_REQUEST
[
'search_max_time'
]
.
"'"
;
if
(
isset
(
$_REQUEST
[
'search_min_time'
])
&&
$_REQUEST
[
'search_min_time'
]
!=
null
)
{
}
$sql
=
$sql
.
" and tcs.time >= '"
.
$_REQUEST
[
'search_min_time'
]
.
"'"
;
$result
=
$wpdb
->
get_results
(
$sql
);
}
$data
=
array
();
if
(
isset
(
$_REQUEST
[
'search_max_time'
])
&&
$_REQUEST
[
'search_max_time'
]
!=
null
)
{
foreach
(
$result
as
$key
=>
$value
)
{
$sql
=
$sql
.
" and tcs.time <= '"
.
$_REQUEST
[
'search_max_time'
]
.
"'"
;
$demand_type_array
=
array
(
}
(
$value
->
new_house
==
1
)
?
'新房'
:
null
,
$result
=
$wpdb
->
get_results
(
$sql
);
(
$value
->
secondHand_house
==
1
)
?
'二手房'
:
null
,
$data
=
array
();
(
$value
->
rent_house
==
1
)
?
'租房'
:
null
foreach
(
$result
as
$key
=>
$value
)
{
);
$demand_type_array
=
array
(
$demand_type_array
=
array_filter
(
$demand_type_array
,
function
(
$var
)
{
(
$value
->
new_house
==
1
)
?
'新房'
:
null
,
return
!
is_null
(
$var
);
(
$value
->
secondHand_house
==
1
)
?
'二手房'
:
null
,
});
(
$value
->
rent_house
==
1
)
?
'租房'
:
null
$data
[
$key
]
=
array
(
);
'id'
=>
$value
->
id
,
$demand_type_array
=
array_filter
(
$demand_type_array
,
function
(
$var
)
{
'name'
=>
$value
->
name
,
return
!
is_null
(
$var
);
'demand_type'
=>
implode
(
"、"
,
$demand_type_array
),
});
'customer_remark'
=>
$value
->
customer_remark
,
$data
[
$key
]
=
array
(
'consultant_id'
=>
$value
->
consultant_id
,
'id'
=>
$value
->
id
,
'consultant_name'
=>
$value
->
consultant_name
,
'name'
=>
$value
->
name
,
'status_name'
=>
$value
->
status_name
'demand_type'
=>
implode
(
"、"
,
$demand_type_array
),
);
'customer_remark'
=>
$value
->
customer_remark
,
}
'consultant_id'
=>
$value
->
consultant_id
,
'consultant_name'
=>
$value
->
consultant_name
,
$current_page
=
$this
->
get_pagenum
();
'status_name'
=>
$value
->
status_name
);
$total_items
=
count
(
$data
);
}
$total_pages
=
ceil
(
$total_items
/
$per_page
);
$current_page
=
$this
->
get_pagenum
();
if
(
$_REQUEST
[
'paged'
]
>
$total_pages
)
{
$current_page
=
$total_pages
;
$total_items
=
count
(
$data
);
}
$total_pages
=
ceil
(
$total_items
/
$per_page
);
$data
=
array_slice
(
$data
,
((
$current_page
-
1
)
*
$per_page
),
$per_page
);
if
(
$_REQUEST
[
'paged'
]
>
$total_pages
)
{
$current_page
=
$total_pages
;
$this
->
items
=
$data
;
}
$this
->
set_pagination_args
(
array
(
$data
=
array_slice
(
$data
,
((
$current_page
-
1
)
*
$per_page
),
$per_page
);
'total_items'
=>
$total_items
,
//WE have to calculate the total number of items
'per_page'
=>
$per_page
,
//WE have to determine how many items to show on a page
$this
->
items
=
$data
;
'total_pages'
=>
ceil
(
$total_items
/
$per_page
)
//WE have to calculate the total number of pages
));
$this
->
set_pagination_args
(
array
(
}
'total_items'
=>
$total_items
,
//WE have to calculate the total number of items
}
'per_page'
=>
$per_page
,
//WE have to determine how many items to show on a page
'total_pages'
=>
ceil
(
$total_items
/
$per_page
)
//WE have to calculate the total number of pages
function
function_customerList
()
));
{
}
$context
=
array
();
}
//
$context
[
'city'
]
=
SearchDao
::
searchCity
();
function
function_customerList
()
$context
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
{
//
$context
=
array
();
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
5
);
$context
[
'customer_type'
]
=
SearchDao
::
searchStatusType
(
6
);
$context
[
'city'
]
=
SearchDao
::
searchCity
();
if
(
isset
(
$_REQUEST
[
'hasSearch'
]))
{
if
(
isset
(
$_REQUEST
[
'hasSearch'
]))
{
$context
[
'req'
]
=
$_REQUEST
;
$context
[
'district'
]
=
SearchDao
::
searchCity
(
$_REQUEST
[
'listCity'
]);
}
$context
[
'plate'
]
=
SearchDao
::
searchCity
(
$_REQUEST
[
'listCity'
],
$_REQUEST
[
'listDistrict'
]);
$context
[
'dicTotalPrice'
]
=
searchDao
::
searchTotalPrice
(
$_REQUEST
[
'listCity'
]);
Timber
::
render
(
"customerList.html"
,
$context
);
$context
[
'dicRentalPrice'
]
=
searchDao
::
searchRentalPrice
(
$_REQUEST
[
'listCity'
]);
}
$context
[
'dicArea'
]
=
searchDao
::
searchArea
(
$_REQUEST
[
'listCity'
]);
$context
[
'cityId'
]
=
$_REQUEST
[
'listCity'
];
function
addCustomerTable
()
$context
[
'districtId'
]
=
$_REQUEST
[
'listDistrict'
];
{
$context
[
'plateId'
]
=
$_REQUEST
[
'listPlate'
];
$_SERVER
[
'REQUEST_URI'
]
=
remove_query_arg
(
'_wp_http_referer'
,
$_SERVER
[
'REQUEST_URI'
]);
$context
[
'buildPropertyId'
]
=
$_REQUEST
[
'buildProperty'
];
$customerList
=
new
customerList
();
$context
[
'totalPrice'
]
=
$_REQUEST
[
'totalPrice'
];
$customerList
->
prepare_items
();
$context
[
'rentalPrice'
]
=
$_REQUEST
[
'rentalPrice'
];
$customerList
->
display
();
$context
[
'acreage'
]
=
$_REQUEST
[
'acreage'
];
}
}
?>
$context
[
'status_id'
]
=
$_REQUEST
[
'status'
];
$context
[
'demand_type'
]
=
isset
(
$_REQUEST
[
'demand_type'
])
?
$_REQUEST
[
'demand_type'
]
:
-
1
;
$context
[
'customer_type_id'
]
=
isset
(
$_REQUEST
[
'customer_type'
])
?
$_REQUEST
[
'customer_type'
]
:
-
1
;
$context
[
'search_name'
]
=
$_REQUEST
[
'search_name'
];
$context
[
'search_consultant_name'
]
=
$_REQUEST
[
'search_consultant_name'
];
$context
[
'search_phone'
]
=
$_REQUEST
[
'search_phone'
];
$context
[
'search_min_time'
]
=
$_REQUEST
[
'search_min_time'
];
$context
[
'search_max_time'
]
=
$_REQUEST
[
'search_max_time'
];
Timber
::
render
(
"customerList.html"
,
$context
);
}
function
addCustomerTable
()
{
$_SERVER
[
'REQUEST_URI'
]
=
remove_query_arg
(
'_wp_http_referer'
,
$_SERVER
[
'REQUEST_URI'
]
);
$customerList
=
new
customerList
();
$customerList
->
prepare_items
();
$customerList
->
display
();
}
?>
wp-content/plugins/tospur/Admin/customerTrackingList.php
View file @
102311c9
<?php
<?php
if
(
!
class_exists
(
'WP_List_Table'
))
{
if
(
!
class_exists
(
'WP_List_Table'
))
{
require_once
(
ABSPATH
.
'wp-admin/includes/class-wp-list-table.php'
);
require_once
(
ABSPATH
.
'wp-admin/includes/class-wp-list-table.php'
);
}
}
class
customerTrackingList
extends
WP_List_Table
class
customerTrackingList
extends
WP_List_Table
{
{
function
__construct
()
function
__construct
()
{
{
}
}
function
column_default
(
$item
,
$column_name
)
function
column_default
(
$item
,
$column_name
)
{
{
switch
(
$column_name
)
{
switch
(
$column_name
)
{
default
:
default
:
return
$item
[
$column_name
];
return
$item
[
$column_name
];
}
}
}
}
function
get_columns
()
function
get_columns
()
{
{
$columns
[
'status_name'
]
=
'跟进类型'
;
$columns
[
'status_name'
]
=
'跟进类型'
;
$columns
[
'consultant_name'
]
=
'置业顾问'
;
$columns
[
'consultant_name'
]
=
'置业顾问'
;
$columns
[
'time'
]
=
'时间'
;
$columns
[
'time'
]
=
'时间'
;
$columns
[
'description'
]
=
'跟进说明'
;
$columns
[
'description'
]
=
'跟进说明'
;
$columns
[
'origin'
]
=
'客/房源'
;
$columns
[
'origin'
]
=
'客/房源'
;
return
$columns
;
return
$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
();
$this
->
_column_headers
=
array
(
$columns
,
$hidden
);
$this
->
_column_headers
=
array
(
$columns
,
$hidden
);
$sql
=
"SELECT tct.*,ts.status_name,tc.name as consultant_name FROM tospur_customer_tracking tct"
.
$sql
=
"SELECT tct.*,ts.status_name,tc.name as consultant_name,tc.subsidiaryId FROM tospur_customer_tracking tct"
.
" left join (SELECT * FROM tospur_status where status_type = 3) as ts on tct.status_type = ts.status_id"
.
" left join (SELECT * FROM tospur_status where status_type = 3) as ts on tct.status_type = ts.status_id"
.
" left join tospur_consultant tc on tct.consultant_id = tc.id where 1 = 1"
;
" left join tospur_consultant tc on tct.consultant_id = tc.id"
.
if
(
isset
(
$_REQUEST
[
'status_type'
])
&&
$_REQUEST
[
'status_type'
]
!=
-
1
)
{
" left join tospur_organization torg on tc.subsidiaryId = torg.id"
.
$sql
=
$sql
.
" and tct.status_type = "
.
$_REQUEST
[
'status_type'
];
" where 1 = 1"
;
}
if
(
current_user_can
(
'zygw'
))
{
if
(
isset
(
$_REQUEST
[
'search_consultant_name'
]))
{
$sql
=
$sql
.
" and tc.id = "
.
get_current_user_id
();
$sql
=
$sql
.
" and tc.name like '%"
.
$_REQUEST
[
'search_consultant_name'
]
.
"%'"
;
}
}
if
(
isset
(
$_REQUEST
[
'organization'
])
&&
$_REQUEST
[
'organization'
]
!=
-
1
)
{
if
(
isset
(
$_REQUEST
[
'search_min_time'
])
&&
$_REQUEST
[
'search_min_time'
]
!=
null
)
{
$sql
=
$sql
.
" and tc.subsidiaryId = "
.
$_REQUEST
[
'organization'
];
$sql
=
$sql
.
" and tct.time >= '"
.
$_REQUEST
[
'search_min_time'
]
.
"'"
;
}
}
if
(
isset
(
$_REQUEST
[
'status_type'
])
&&
$_REQUEST
[
'status_type'
]
!=
-
1
)
{
if
(
isset
(
$_REQUEST
[
'search_max_time'
])
&&
$_REQUEST
[
'search_max_time'
]
!=
null
)
{
$sql
=
$sql
.
" and tct.status_type = "
.
$_REQUEST
[
'status_type'
];
$sql
=
$sql
.
" and tct.time <= '"
.
$_REQUEST
[
'search_max_time'
]
.
"'"
;
}
}
if
(
isset
(
$_REQUEST
[
'search_consultant_name'
])
&&
$_REQUEST
[
'search_consultant_name'
]
!=
null
)
{
$sql
=
$sql
.
" order by tct.time desc"
;
$sql
=
$sql
.
" and tc.name like '%"
.
$_REQUEST
[
'search_consultant_name'
]
.
"%'"
;
$result
=
$wpdb
->
get_results
(
$sql
);
}
$data
=
array
();
if
(
isset
(
$_REQUEST
[
'search_min_time'
])
&&
$_REQUEST
[
'search_min_time'
]
!=
null
)
{
foreach
(
$result
as
$key
=>
$value
)
{
$sql
=
$sql
.
" and tct.time >= '"
.
$_REQUEST
[
'search_min_time'
]
.
"'"
;
$data
[
$key
]
=
array
(
}
'id'
=>
$value
->
id
,
if
(
isset
(
$_REQUEST
[
'search_max_time'
])
&&
$_REQUEST
[
'search_max_time'
]
!=
null
)
{
'status_id'
=>
$value
->
status_id
,
$sql
=
$sql
.
" and tct.time <= '"
.
$_REQUEST
[
'search_max_time'
]
.
"'"
;
'status_name'
=>
$value
->
status_name
,
}
'consultant_name'
=>
$value
->
consultant_name
,
$sql
=
$sql
.
" order by tct.time desc"
;
'time'
=>
$value
->
time
,
$result
=
$wpdb
->
get_results
(
$sql
);
'description'
=>
$value
->
description
,
$data
=
array
();
'origin'
=>
(
$value
->
origin
==
1
)
?
'房源'
:
((
$value
->
origin
==
2
)
?
'客源'
:
''
)
foreach
(
$result
as
$key
=>
$value
)
{
);
$data
[
$key
]
=
array
(
}
'id'
=>
$value
->
id
,
'status_id'
=>
$value
->
status_id
,
$current_page
=
$this
->
get_pagenum
();
'status_name'
=>
$value
->
status_name
,
'consultant_name'
=>
$value
->
consultant_name
,
$total_items
=
count
(
$data
);
'time'
=>
$value
->
time
,
$total_pages
=
ceil
(
$total_items
/
$per_page
);
'description'
=>
$value
->
description
,
'origin'
=>
(
$value
->
origin
==
1
)
?
'房源'
:
((
$value
->
origin
==
2
)
?
'客源'
:
''
)
if
(
$_REQUEST
[
'paged'
]
>
$total_pages
)
{
);
$current_page
=
$total_pages
;
}
}
$current_page
=
$this
->
get_pagenum
();
$data
=
array_slice
(
$data
,
((
$current_page
-
1
)
*
$per_page
),
$per_page
);
$total_items
=
count
(
$data
);
$this
->
items
=
$data
;
$total_pages
=
ceil
(
$total_items
/
$per_page
);
$this
->
set_pagination_args
(
array
(
if
(
$_REQUEST
[
'paged'
]
>
$total_pages
)
{
'total_items'
=>
$total_items
,
//WE have to calculate the total number of items
$current_page
=
$total_pages
;
'per_page'
=>
$per_page
,
//WE have to determine how many items to show on a page
}
'total_pages'
=>
ceil
(
$total_items
/
$per_page
)
//WE have to calculate the total number of pages
));
$data
=
array_slice
(
$data
,
((
$current_page
-
1
)
*
$per_page
),
$per_page
);
}
}
$this
->
items
=
$data
;
function
function_customerTrackingList
()
$this
->
set_pagination_args
(
array
(
{
'total_items'
=>
$total_items
,
//WE have to calculate the total number of items
$context
=
array
();
'per_page'
=>
$per_page
,
//WE have to determine how many items to show on a page
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
3
);
'total_pages'
=>
ceil
(
$total_items
/
$per_page
)
//WE have to calculate the total number of pages
$context
[
'status_type'
]
=
isset
(
$_REQUEST
[
'status_type'
])
?
$_REQUEST
[
'status_type'
]
:
-
1
;
));
$context
[
'search_consultant_name'
]
=
$_REQUEST
[
'search_consultant_name'
];
}
$context
[
'search_min_time'
]
=
$_REQUEST
[
'search_min_time'
];
}
$context
[
'search_max_time'
]
=
$_REQUEST
[
'search_max_time'
];
function
function_customerTrackingList
()
Timber
::
render
(
"customerTrackingList.html"
,
$context
);
{
}
$context
=
array
();
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
3
);
function
addCustomerTrackingTable
()
$context
[
'req'
]
=
$_REQUEST
;
{
$_SERVER
[
'REQUEST_URI'
]
=
remove_query_arg
(
'_wp_http_referer'
,
$_SERVER
[
'REQUEST_URI'
]
);
Timber
::
render
(
"customerTrackingList.html"
,
$context
);
$customerTrackingList
=
new
customerTrackingList
();
}
$customerTrackingList
->
prepare_items
();
$customerTrackingList
->
display
();
function
addCustomerTrackingTable
()
}
{
$_SERVER
[
'REQUEST_URI'
]
=
remove_query_arg
(
'_wp_http_referer'
,
$_SERVER
[
'REQUEST_URI'
]);
?>
$customerTrackingList
=
new
customerTrackingList
();
$customerTrackingList
->
prepare_items
();
$customerTrackingList
->
display
();
}
?>
wp-content/plugins/tospur/Admin/introduction.php
View file @
102311c9
...
@@ -4,17 +4,19 @@ class introduction
...
@@ -4,17 +4,19 @@ class introduction
{
{
public
static
function
ajax_submit_introduction
()
public
static
function
ajax_submit_introduction
()
{
{
$time
=
$_POST
[
'time'
];
$introduction
=
$_POST
[
'introduction'
];
$introduction
=
$_POST
[
'introduction'
];
$user_id
=
$_POST
[
'user_id'
];
$user_id
=
$_POST
[
'user_id'
];
wp_send_json
(
introduction
::
submit_introduction
(
$introduction
,
$user_id
));
wp_send_json
(
introduction
::
submit_introduction
(
$
time
,
$
introduction
,
$user_id
));
}
}
public
static
function
submit_introduction
(
$introduction
,
$user_id
)
public
static
function
submit_introduction
(
$
time
,
$
introduction
,
$user_id
)
{
{
global
$wpdb
;
global
$wpdb
;
$result
=
$wpdb
->
update
(
$result
=
$wpdb
->
update
(
Config
::
TOSPUR_CONSULTANT
,
Config
::
TOSPUR_CONSULTANT
,
array
(
array
(
'time'
=>
$time
,
'introduction'
=>
$introduction
'introduction'
=>
$introduction
),
),
array
(
'id'
=>
$user_id
)
array
(
'id'
=>
$user_id
)
...
@@ -22,12 +24,12 @@ class introduction
...
@@ -22,12 +24,12 @@ class introduction
return
$result
;
return
$result
;
}
}
public
static
function
search_introduction
()
public
static
function
search_
time_and_
introduction
()
{
{
global
$wpdb
;
global
$wpdb
;
$user_id
=
introduction
::
get_user_id
();
$user_id
=
introduction
::
get_user_id
();
$sql
=
"select introduction from "
.
Config
::
TOSPUR_CONSULTANT
.
" where id = "
.
$user_id
;
$sql
=
"select
time,
introduction from "
.
Config
::
TOSPUR_CONSULTANT
.
" where id = "
.
$user_id
;
$result
=
$wpdb
->
get_
var
(
$sql
);
$result
=
$wpdb
->
get_
row
(
$sql
);
return
$result
;
return
$result
;
}
}
...
@@ -35,7 +37,9 @@ class introduction
...
@@ -35,7 +37,9 @@ class introduction
{
{
$context
=
array
();
$context
=
array
();
$context
[
'url'
]
=
home_url
();
$context
[
'url'
]
=
home_url
();
$context
[
'introduction'
]
=
introduction
::
search_introduction
();
$result
=
introduction
::
search_time_and_introduction
();
$context
[
'time'
]
=
$result
->
time
;
$context
[
'introduction'
]
=
$result
->
introduction
;
$user_id
=
introduction
::
get_user_id
();
$user_id
=
introduction
::
get_user_id
();
$context
[
'user_id'
]
=
$user_id
;
$context
[
'user_id'
]
=
$user_id
;
Timber
::
render
(
'introduction.html'
,
$context
);
Timber
::
render
(
'introduction.html'
,
$context
);
...
...
wp-content/plugins/tospur/Admin/newHouseList.php
View file @
102311c9
...
@@ -12,25 +12,31 @@ class newHouseList extends WP_List_Table
...
@@ -12,25 +12,31 @@ class newHouseList extends WP_List_Table
global
$wpdb
;
global
$wpdb
;
$current_url
=
set_url_scheme
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
]
);
$current_url
=
set_url_scheme
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
]
);
$current_url
=
remove_query_arg
(
array
(
'paged'
,
'type'
),
$current_url
);
$current_url
=
remove_query_arg
(
array
(
'paged'
,
'type'
),
$current_url
);
$sql
=
"select COUNT(NULLIF(approval != -2, false)) as needCheckNum,
$sql
=
"select COUNT(*) as allNum,
COUNT(NULLIF(approval != -2, false)) as needCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = -1, false)) as onSaleNum
COUNT(NULLIF(approval = -1, false)) as onSaleNum,
COUNT(NULLIF(approval = 2, false)) as notSaleNum
from "
.
Config
::
TOSPUR_HOUSE_TABLE
.
" where house_type = 0"
;
from "
.
Config
::
TOSPUR_HOUSE_TABLE
.
" where house_type = 0"
;
$result
=
$wpdb
->
get_results
(
$sql
);
$result
=
$wpdb
->
get_results
(
$sql
);
foreach
(
$result
as
$value
){
foreach
(
$result
as
$value
){
$approvalParam
=
array
(
$approvalParam
=
array
(
"allNum"
=>
$value
->
allNum
,
"needCheckNum"
=>
$value
->
needCheckNum
,
"needCheckNum"
=>
$value
->
needCheckNum
,
"unCheckNum"
=>
$value
->
unCheckNum
,
"unCheckNum"
=>
$value
->
unCheckNum
,
"checkNum"
=>
$value
->
checkNum
,
"checkNum"
=>
$value
->
checkNum
,
"onSaleNum"
=>
$value
->
onSaleNum
"onSaleNum"
=>
$value
->
onSaleNum
,
"notSaleNum"
=>
$value
->
notSaleNum
);
);
}
}
return
array
(
return
array
(
"allNum"
=>
'<a href="'
.
$current_url
.
'&approval=" class="current">全部<span class="count">('
.
$approvalParam
[
"allNum"
]
.
')</span></a>'
,
"needCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=-2" class="current">需审批<span class="count">('
.
$approvalParam
[
"needCheckNum"
]
.
')</span></a>'
,
"needCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=-2" class="current">需审批<span class="count">('
.
$approvalParam
[
"needCheckNum"
]
.
')</span></a>'
,
"unCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=0">未审核<span class="count">('
.
$approvalParam
[
"unCheckNum"
]
.
')</span></a>'
,
"unCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=0">未审核<span class="count">('
.
$approvalParam
[
"unCheckNum"
]
.
')</span></a>'
,
"checkNum"
=>
'<a href="'
.
$current_url
.
'&approval=1">审核<span class="count">('
.
$approvalParam
[
"checkNum"
]
.
')</span></a>'
,
"checkNum"
=>
'<a href="'
.
$current_url
.
'&approval=1">审核<span class="count">('
.
$approvalParam
[
"checkNum"
]
.
')</span></a>'
,
"onSaleNum"
=>
'<a href="'
.
$current_url
.
'&approval=-1">交易中<span class="count">('
.
$approvalParam
[
"onSaleNum"
]
.
')</span></a>'
"onSaleNum"
=>
'<a href="'
.
$current_url
.
'&approval=-1">交易中<span class="count">('
.
$approvalParam
[
"onSaleNum"
]
.
')</span></a>'
,
"notSaleNum"
=>
'<a href="'
.
$current_url
.
'&approval=-1">下架<span class="count">('
.
$approvalParam
[
"notSaleNum"
]
.
')</span></a>'
);
);
}
function
__construct
()
}
function
__construct
()
{
{
...
@@ -130,7 +136,7 @@ class newHouseList extends WP_List_Table
...
@@ -130,7 +136,7 @@ class newHouseList extends WP_List_Table
function
get_bulk_actions
()
function
get_bulk_actions
()
{
{
if
(
current_user_can
(
'
moderate_comments
'
)
)
{
if
(
current_user_can
(
'
houseApproval
'
)
)
{
$actions
=
array
(
$actions
=
array
(
"agree"
=>
"通过"
,
"agree"
=>
"通过"
,
"goBack"
=>
"退回"
"goBack"
=>
"退回"
...
@@ -140,6 +146,7 @@ class newHouseList extends WP_List_Table
...
@@ -140,6 +146,7 @@ class newHouseList extends WP_List_Table
'unCheck'
=>
'未审核'
,
'unCheck'
=>
'未审核'
,
'check'
=>
'审核'
,
'check'
=>
'审核'
,
'onSale'
=>
'交易中'
,
'onSale'
=>
'交易中'
,
'notSale'
=>
'下架'
);
);
}
}
return
$actions
;
return
$actions
;
...
@@ -205,9 +212,9 @@ class newHouseList extends WP_List_Table
...
@@ -205,9 +212,9 @@ class newHouseList extends WP_List_Table
if
(
$action
)
{
if
(
$action
)
{
$string
=
null
;
$string
=
null
;
$status
=
null
;
$status
=
null
;
$id
=
$_REQUEST
[
'newhouselist'
];
switch
(
$action
)
{
switch
(
$action
)
{
case
'unCheck'
:
case
'unCheck'
:
$id
=
$_REQUEST
[
'newhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
0
);
$res
=
$this
->
getCurrentStatus
(
$string
,
0
);
...
@@ -218,7 +225,6 @@ class newHouseList extends WP_List_Table
...
@@ -218,7 +225,6 @@ class newHouseList extends WP_List_Table
}
}
break
;
break
;
case
'check'
:
case
'check'
:
$id
=
$_REQUEST
[
'newhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
1
);
$res
=
$this
->
getCurrentStatus
(
$string
,
1
);
...
@@ -229,7 +235,6 @@ class newHouseList extends WP_List_Table
...
@@ -229,7 +235,6 @@ class newHouseList extends WP_List_Table
}
}
break
;
break
;
case
'onSale'
:
case
'onSale'
:
$id
=
$_REQUEST
[
'newhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
-
1
);
$res
=
$this
->
getCurrentStatus
(
$string
,
-
1
);
...
@@ -239,6 +244,16 @@ class newHouseList extends WP_List_Table
...
@@ -239,6 +244,16 @@ class newHouseList extends WP_List_Table
$status
=
$res
;
$status
=
$res
;
}
}
break
;
break
;
case
'notSale'
:
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
2
);
if
(
!
$res
){
exit
;
}
$status
=
$res
;
}
break
;
}
}
global
$wpdb
;
global
$wpdb
;
$result
=
$wpdb
->
query
(
$wpdb
->
prepare
(
'update tospur_house SET approval=%d where id in '
.
$string
,
$status
));
$result
=
$wpdb
->
query
(
$wpdb
->
prepare
(
'update tospur_house SET approval=%d where id in '
.
$string
,
$status
));
...
@@ -258,7 +273,7 @@ class newHouseList extends WP_List_Table
...
@@ -258,7 +273,7 @@ class newHouseList extends WP_List_Table
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
if
(
current_user_can
(
'
moderate_comments
'
)
)
{
if
(
current_user_can
(
'
houseApproval
'
)
)
{
$this
->
manage_bulk_action
();
$this
->
manage_bulk_action
();
}
else
{
}
else
{
$this
->
process_bulk_action
();
$this
->
process_bulk_action
();
...
@@ -322,7 +337,7 @@ class newHouseList extends WP_List_Table
...
@@ -322,7 +337,7 @@ class newHouseList extends WP_List_Table
$sql
=
$sql
.
" and name like %s"
;
$sql
=
$sql
.
" and name like %s"
;
}
}
if
(
isset
(
$_REQUEST
[
"approval"
])){
if
(
isset
(
$_REQUEST
[
"approval"
])
&&
$_REQUEST
[
"approval"
]
!=
""
){
if
(
$_REQUEST
[
"approval"
]
==
-
2
){
if
(
$_REQUEST
[
"approval"
]
==
-
2
){
$params
[]
=
$_REQUEST
[
"approval"
];
$params
[]
=
$_REQUEST
[
"approval"
];
$sql
=
$sql
.
" and approval != %d"
;
$sql
=
$sql
.
" and approval != %d"
;
...
...
wp-content/plugins/tospur/Admin/rentHouse.php
View file @
102311c9
...
@@ -50,14 +50,41 @@ class RentHouse extends Tospur_House{
...
@@ -50,14 +50,41 @@ class RentHouse extends Tospur_House{
"entrustDay"
=>
$_POST
[
"entrustDay"
],
"entrustDay"
=>
$_POST
[
"entrustDay"
],
"deadLine"
=>
$_POST
[
"deadLine"
],
"deadLine"
=>
$_POST
[
"deadLine"
],
"rent"
=>
$_POST
[
"rent"
],
"rent"
=>
$_POST
[
"rent"
],
"status"
=>
$_POST
[
"status
"
],
"property_money"
=>
$_POST
[
"property_money
"
],
"property_money"
=>
$_POST
[
"property_money
"
]
"parking_spaces"
=>
$_POST
[
"parking_spaces
"
]
);
);
if
(
$type
==
3
){
if
(
$type
==
3
){
$wpdb
->
query
(
"START TRANSACTION"
);
$wpdb
->
query
(
"START TRANSACTION"
);
if
(
isset
(
$_POST
[
'houseId'
])){
if
(
isset
(
$_POST
[
'houseId'
])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if
(
$_POST
[
"userType"
]
==
0
){
//经理
//通过
if
(
$_POST
[
"status"
]
!=
-
2
){
$insert_tospur_house_array
[
"status"
]
=
$_POST
[
"status"
];
$insert_tospur_house_array
[
"approval"
]
=
-
2
;
}
else
{
//退回
$insert_tospur_house_array
[
"approval"
]
=
$_POST
[
"status"
];
}
}
else
{
//置业顾问
$currentStatus
=
SearchDao
::
getDetailInfo
(
$_POST
[
"userType"
]);
//修改了状态
if
(
$currentStatus
[
"result"
]
->
status
!=
$_POST
[
"status"
]){
$insert_tospur_house_array
[
"approval"
]
=
$_POST
[
"status"
];
}
else
{
//没有修改状态
//没有申请审批
if
(
$currentStatus
[
"result"
]
->
approval
==
-
2
){
$insert_tospur_house_array
[
"approval"
]
=
$currentStatus
[
"result"
]
->
status
;
}
else
{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array
[
"approval"
]
=
$currentStatus
[
"result"
]
->
approval
;
}
}
}
$result
=
RentHouse
::
data_update
(
$_POST
[
'houseId'
],
$insert_tospur_house_array
);
$result
=
RentHouse
::
data_update
(
$_POST
[
'houseId'
],
$insert_tospur_house_array
);
CustomerTrackingDao
::
insert
(
$_POST
[
'houseId'
],
$_REQUEST
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
print_r
(
$result
);;
print_r
(
$result
);;
...
@@ -68,6 +95,8 @@ class RentHouse extends Tospur_House{
...
@@ -68,6 +95,8 @@ class RentHouse extends Tospur_House{
}
}
}
else
{
}
else
{
$insert_tospur_house_array
[
"status"
]
=
0
;
$insert_tospur_house_array
[
"approval"
]
=
1
;
$result
=
RentHouse
::
rentHouseData_insert
(
$insert_tospur_house_array
);
$result
=
RentHouse
::
rentHouseData_insert
(
$insert_tospur_house_array
);
if
(
is_numeric
(
$result
))
{
if
(
is_numeric
(
$result
))
{
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
...
@@ -87,7 +116,7 @@ class RentHouse extends Tospur_House{
...
@@ -87,7 +116,7 @@ class RentHouse extends Tospur_House{
$context
[
"mark"
]
=
SearchDao
::
searchHouseTag
(
$_GET
[
'id'
]);
$context
[
"mark"
]
=
SearchDao
::
searchHouseTag
(
$_GET
[
'id'
]);
$context
[
"status"
]
=
searchDao
::
searchStatusType
(
2
);
$context
[
"status"
]
=
searchDao
::
searchStatusType
(
2
);
}
}
$context
[
'
role'
]
=
RentHouse
::
getCurrentRole
();
$context
[
'
canApproval'
]
=
House
::
canApproval
();
$context
[
"city"
]
=
SearchDao
::
searchCity
();
$context
[
"city"
]
=
SearchDao
::
searchCity
();
$context
[
"buildProperty"
]
=
SearchDao
::
searchBuildProperty
();
$context
[
"buildProperty"
]
=
SearchDao
::
searchBuildProperty
();
$context
[
"room"
]
=
SearchDao
::
searchRoom
();
$context
[
"room"
]
=
SearchDao
::
searchRoom
();
...
@@ -170,11 +199,12 @@ class RentHouse extends Tospur_House{
...
@@ -170,11 +199,12 @@ class RentHouse extends Tospur_House{
}
}
$wpdb
->
delete
(
Config
::
A_HOUSE_USER_TABLE
,
array
(
"house_id"
=>
$houseId
));
$wpdb
->
delete
(
Config
::
A_HOUSE_USER_TABLE
,
array
(
"house_id"
=>
$houseId
));
$result
=
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
$result
=
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
return
$result
;
return
$result
;
}
}
InsertDao
::
addHouseTag
(
$houseId
,
$data
[
'houseTag'
]);
InsertDao
::
addHouseTag
(
$houseId
,
$data
[
'houseTag'
]);
CustomerTrackingDao
::
insert
(
$_POST
[
'houseId'
],
$_REQUEST
);
return
$result
;
return
$result
;
}
}
}
}
...
...
wp-content/plugins/tospur/Admin/rentHouseList.php
View file @
102311c9
...
@@ -10,7 +10,8 @@ class rentHouseList extends WP_List_Table
...
@@ -10,7 +10,8 @@ class rentHouseList extends WP_List_Table
global
$wpdb
;
global
$wpdb
;
$current_url
=
set_url_scheme
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
]
);
$current_url
=
set_url_scheme
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
]
);
$current_url
=
remove_query_arg
(
array
(
'paged'
,
'type'
),
$current_url
);
$current_url
=
remove_query_arg
(
array
(
'paged'
,
'type'
),
$current_url
);
$sql
=
"select COUNT(NULLIF(approval != -2, false)) as needCheckNum,
$sql
=
"select COUNT(*) as allNum,
COUNT(NULLIF(approval != -2, false)) as needCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = -1, false)) as onSaleNum,
COUNT(NULLIF(approval = -1, false)) as onSaleNum,
...
@@ -22,6 +23,7 @@ class rentHouseList extends WP_List_Table
...
@@ -22,6 +23,7 @@ class rentHouseList extends WP_List_Table
$result
=
$wpdb
->
get_results
(
$sql
);
$result
=
$wpdb
->
get_results
(
$sql
);
foreach
(
$result
as
$value
){
foreach
(
$result
as
$value
){
$approvalParam
=
array
(
$approvalParam
=
array
(
"allNum"
=>
$value
->
allNum
,
"needCheckNum"
=>
$value
->
needCheckNum
,
"needCheckNum"
=>
$value
->
needCheckNum
,
"unCheckNum"
=>
$value
->
unCheckNum
,
"unCheckNum"
=>
$value
->
unCheckNum
,
"checkNum"
=>
$value
->
checkNum
,
"checkNum"
=>
$value
->
checkNum
,
...
@@ -33,6 +35,7 @@ class rentHouseList extends WP_List_Table
...
@@ -33,6 +35,7 @@ class rentHouseList extends WP_List_Table
);
);
}
}
return
array
(
return
array
(
"allNum"
=>
'<a href="'
.
$current_url
.
'&approval" class="current">全部<span class="count">('
.
$approvalParam
[
"allNum"
]
.
')</span></a>'
,
"needCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=-2" class="current">需审批<span class="count">('
.
$approvalParam
[
"needCheckNum"
]
.
')</span></a>'
,
"needCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=-2" class="current">需审批<span class="count">('
.
$approvalParam
[
"needCheckNum"
]
.
')</span></a>'
,
"unCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=0">未审核<span class="count">('
.
$approvalParam
[
"unCheckNum"
]
.
')</span></a>'
,
"unCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=0">未审核<span class="count">('
.
$approvalParam
[
"unCheckNum"
]
.
')</span></a>'
,
"checkNum"
=>
'<a href="'
.
$current_url
.
'&approval=1">审核<span class="count">('
.
$approvalParam
[
"checkNum"
]
.
')</span></a>'
,
"checkNum"
=>
'<a href="'
.
$current_url
.
'&approval=1">审核<span class="count">('
.
$approvalParam
[
"checkNum"
]
.
')</span></a>'
,
...
@@ -129,7 +132,7 @@ class rentHouseList extends WP_List_Table
...
@@ -129,7 +132,7 @@ class rentHouseList extends WP_List_Table
function
get_bulk_actions
()
function
get_bulk_actions
()
{
{
if
(
current_user_can
(
'
moderate_comments
'
)
)
{
if
(
current_user_can
(
'
houseApproval
'
)
)
{
$actions
=
array
(
$actions
=
array
(
"agree"
=>
"通过"
,
"agree"
=>
"通过"
,
"goBack"
=>
"退回"
"goBack"
=>
"退回"
...
@@ -206,7 +209,9 @@ class rentHouseList extends WP_List_Table
...
@@ -206,7 +209,9 @@ class rentHouseList extends WP_List_Table
function
process_bulk_action
()
function
process_bulk_action
()
{
{
$action
=
$this
->
current_action
();
$action
=
$this
->
current_action
();
global
$wpdb
;
if
(
$action
)
{
global
$wpdb
;
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$action
)
{
$string
=
null
;
$string
=
null
;
$status
=
null
;
$status
=
null
;
if
(
$action
==
'allot'
){
if
(
$action
==
'allot'
){
...
@@ -214,7 +219,6 @@ class rentHouseList extends WP_List_Table
...
@@ -214,7 +219,6 @@ class rentHouseList extends WP_List_Table
}
else
{
}
else
{
switch
(
$action
)
{
switch
(
$action
)
{
case
'unCheck'
:
case
'unCheck'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
0
);
$res
=
$this
->
getCurrentStatus
(
$string
,
0
);
...
@@ -225,7 +229,6 @@ class rentHouseList extends WP_List_Table
...
@@ -225,7 +229,6 @@ class rentHouseList extends WP_List_Table
}
}
break
;
break
;
case
'check'
:
case
'check'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
1
);
$res
=
$this
->
getCurrentStatus
(
$string
,
1
);
...
@@ -236,7 +239,6 @@ class rentHouseList extends WP_List_Table
...
@@ -236,7 +239,6 @@ class rentHouseList extends WP_List_Table
}
}
break
;
break
;
case
'selfSale'
:
case
'selfSale'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
2
);
$res
=
$this
->
getCurrentStatus
(
$string
,
2
);
...
@@ -247,7 +249,6 @@ class rentHouseList extends WP_List_Table
...
@@ -247,7 +249,6 @@ class rentHouseList extends WP_List_Table
}
}
break
;
break
;
case
'otherSale'
:
case
'otherSale'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
3
);
$res
=
$this
->
getCurrentStatus
(
$string
,
3
);
...
@@ -258,7 +259,6 @@ class rentHouseList extends WP_List_Table
...
@@ -258,7 +259,6 @@ class rentHouseList extends WP_List_Table
}
}
break
;
break
;
case
'invalid'
:
case
'invalid'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
4
);
$res
=
$this
->
getCurrentStatus
(
$string
,
4
);
...
@@ -269,7 +269,6 @@ class rentHouseList extends WP_List_Table
...
@@ -269,7 +269,6 @@ class rentHouseList extends WP_List_Table
}
}
break
;
break
;
case
'reactivation'
:
case
'reactivation'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
);
$res
=
$this
->
getCurrentStatus
(
$string
);
...
@@ -284,7 +283,6 @@ class rentHouseList extends WP_List_Table
...
@@ -284,7 +283,6 @@ class rentHouseList extends WP_List_Table
}
}
break
;
break
;
case
'onSale'
:
case
'onSale'
:
$id
=
$_REQUEST
[
'renthouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
-
1
);
$res
=
$this
->
getCurrentStatus
(
$string
,
-
1
);
...
@@ -313,7 +311,7 @@ class rentHouseList extends WP_List_Table
...
@@ -313,7 +311,7 @@ class rentHouseList extends WP_List_Table
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
if
(
current_user_can
(
'
moderate_comments
'
)
)
{
if
(
current_user_can
(
'
houseApproval
'
)
)
{
$this
->
manage_bulk_action
();
$this
->
manage_bulk_action
();
}
else
{
}
else
{
$this
->
process_bulk_action
();
$this
->
process_bulk_action
();
...
@@ -375,7 +373,7 @@ class rentHouseList extends WP_List_Table
...
@@ -375,7 +373,7 @@ class rentHouseList extends WP_List_Table
$sql
=
$sql
.
" and name like %s"
;
$sql
=
$sql
.
" and name like %s"
;
}
}
if
(
isset
(
$_REQUEST
[
"approval"
])){
if
(
isset
(
$_REQUEST
[
"approval"
])
&&
$_REQUEST
[
"approval"
]
!=
""
){
if
(
$_REQUEST
[
"approval"
]
==
-
2
){
if
(
$_REQUEST
[
"approval"
]
==
-
2
){
$params
[]
=
$_REQUEST
[
"approval"
];
$params
[]
=
$_REQUEST
[
"approval"
];
$sql
=
$sql
.
" and approval != %d"
;
$sql
=
$sql
.
" and approval != %d"
;
...
...
wp-content/plugins/tospur/Admin/secHandHouse.php
View file @
102311c9
...
@@ -48,14 +48,42 @@ class SecHandHouse extends Tospur_House{
...
@@ -48,14 +48,42 @@ class SecHandHouse extends Tospur_House{
"garage"
=>
$_POST
[
"garage"
],
"garage"
=>
$_POST
[
"garage"
],
"entrustDay"
=>
$_POST
[
"entrustDay"
],
"entrustDay"
=>
$_POST
[
"entrustDay"
],
"deadLine"
=>
$_POST
[
"deadLine"
],
"deadLine"
=>
$_POST
[
"deadLine"
],
"status"
=>
$_POST
[
"status"
],
"property_money"
=>
$_POST
[
"property_money"
],
"property_money"
=>
$_POST
[
"property_money"
],
"mortgage"
=>
$_POST
[
"mortgage"
]
"mortgage"
=>
$_POST
[
"mortgage"
],
"parking_spaces"
=>
$_POST
[
"parking_spaces"
]
);
);
if
(
$type
==
2
){
if
(
$type
==
2
){
$wpdb
->
query
(
"START TRANSACTION"
);
$wpdb
->
query
(
"START TRANSACTION"
);
if
(
isset
(
$_POST
[
'houseId'
])){
if
(
isset
(
$_POST
[
'houseId'
])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if
(
$_POST
[
"userType"
]
==
0
){
//经理
//通过
if
(
$_POST
[
"status"
]
!=
-
2
){
$insert_tospur_house_array
[
"status"
]
=
$_POST
[
"status"
];
$insert_tospur_house_array
[
"approval"
]
=
-
2
;
}
else
{
//退回
$insert_tospur_house_array
[
"approval"
]
=
$_POST
[
"status"
];
}
}
else
{
//置业顾问
$currentStatus
=
SearchDao
::
getDetailInfo
(
$_POST
[
"userType"
]);
//修改了状态
if
(
$currentStatus
[
"result"
]
->
status
!=
$_POST
[
"status"
]){
$insert_tospur_house_array
[
"approval"
]
=
$_POST
[
"status"
];
}
else
{
//没有修改状态
//没有申请审批
if
(
$currentStatus
[
"result"
]
->
approval
==
-
2
){
$insert_tospur_house_array
[
"approval"
]
=
$currentStatus
[
"result"
]
->
status
;
}
else
{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array
[
"approval"
]
=
$currentStatus
[
"result"
]
->
approval
;
}
}
}
$result
=
SecHandHouse
::
data_update
(
$_POST
[
'houseId'
],
$insert_tospur_house_array
);
$result
=
SecHandHouse
::
data_update
(
$_POST
[
'houseId'
],
$insert_tospur_house_array
);
if
(
!
is_numeric
(
$result
)){
if
(
!
is_numeric
(
$result
)){
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
...
@@ -67,6 +95,8 @@ class SecHandHouse extends Tospur_House{
...
@@ -67,6 +95,8 @@ class SecHandHouse extends Tospur_House{
}
}
}
else
{
}
else
{
$insert_tospur_house_array
[
"status"
]
=
0
;
$insert_tospur_house_array
[
"approval"
]
=
1
;
$result
=
SecHandHouse
::
secHouseData_insert
(
$insert_tospur_house_array
);
$result
=
SecHandHouse
::
secHouseData_insert
(
$insert_tospur_house_array
);
if
(
!
is_numeric
(
$result
))
{
if
(
!
is_numeric
(
$result
))
{
$wpdb
->
query
(
"ROLLBACK"
);
$wpdb
->
query
(
"ROLLBACK"
);
...
@@ -84,7 +114,7 @@ class SecHandHouse extends Tospur_House{
...
@@ -84,7 +114,7 @@ class SecHandHouse extends Tospur_House{
$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'
]
=
SecHandHouse
::
getCurrentRole
();
$context
[
'
canApproval'
]
=
House
::
canApproval
();
$context
[
"city"
]
=
SearchDao
::
searchCity
();
$context
[
"city"
]
=
SearchDao
::
searchCity
();
$context
[
"buildProperty"
]
=
SearchDao
::
searchBuildProperty
();
$context
[
"buildProperty"
]
=
SearchDao
::
searchBuildProperty
();
$context
[
"room"
]
=
SearchDao
::
searchRoom
();
$context
[
"room"
]
=
SearchDao
::
searchRoom
();
...
...
wp-content/plugins/tospur/Admin/secHandHouseList.php
View file @
102311c9
...
@@ -9,7 +9,8 @@ class secHandHouseList extends WP_List_Table
...
@@ -9,7 +9,8 @@ class secHandHouseList extends WP_List_Table
global
$wpdb
;
global
$wpdb
;
$current_url
=
set_url_scheme
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
]
);
$current_url
=
set_url_scheme
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
]
);
$current_url
=
remove_query_arg
(
array
(
'paged'
,
'type'
),
$current_url
);
$current_url
=
remove_query_arg
(
array
(
'paged'
,
'type'
),
$current_url
);
$sql
=
"select COUNT(NULLIF(approval != -2, false)) as needCheckNum,
$sql
=
"select COUNT(*) as allNum,
COUNT(NULLIF(approval != -2, false)) as needCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = -1, false)) as onSaleNum,
COUNT(NULLIF(approval = -1, false)) as onSaleNum,
...
@@ -21,6 +22,7 @@ class secHandHouseList extends WP_List_Table
...
@@ -21,6 +22,7 @@ class secHandHouseList extends WP_List_Table
$result
=
$wpdb
->
get_results
(
$sql
);
$result
=
$wpdb
->
get_results
(
$sql
);
foreach
(
$result
as
$value
){
foreach
(
$result
as
$value
){
$approvalParam
=
array
(
$approvalParam
=
array
(
"allNum"
=>
$value
->
allNum
,
"needCheckNum"
=>
$value
->
needCheckNum
,
"needCheckNum"
=>
$value
->
needCheckNum
,
"unCheckNum"
=>
$value
->
unCheckNum
,
"unCheckNum"
=>
$value
->
unCheckNum
,
"checkNum"
=>
$value
->
checkNum
,
"checkNum"
=>
$value
->
checkNum
,
...
@@ -32,6 +34,7 @@ class secHandHouseList extends WP_List_Table
...
@@ -32,6 +34,7 @@ class secHandHouseList extends WP_List_Table
);
);
}
}
return
array
(
return
array
(
"allNum"
=>
'<a href="'
.
$current_url
.
'&approval" class="current">全部<span class="count">('
.
$approvalParam
[
"allNum"
]
.
')</span></a>'
,
"needCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=-2" class="current">需审批<span class="count">('
.
$approvalParam
[
"needCheckNum"
]
.
')</span></a>'
,
"needCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=-2" class="current">需审批<span class="count">('
.
$approvalParam
[
"needCheckNum"
]
.
')</span></a>'
,
"unCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=0">未审核<span class="count">('
.
$approvalParam
[
"unCheckNum"
]
.
')</span></a>'
,
"unCheckNum"
=>
'<a href="'
.
$current_url
.
'&approval=0">未审核<span class="count">('
.
$approvalParam
[
"unCheckNum"
]
.
')</span></a>'
,
"checkNum"
=>
'<a href="'
.
$current_url
.
'&approval=1">审核<span class="count">('
.
$approvalParam
[
"checkNum"
]
.
')</span></a>'
,
"checkNum"
=>
'<a href="'
.
$current_url
.
'&approval=1">审核<span class="count">('
.
$approvalParam
[
"checkNum"
]
.
')</span></a>'
,
...
@@ -128,7 +131,7 @@ class secHandHouseList extends WP_List_Table
...
@@ -128,7 +131,7 @@ class secHandHouseList extends WP_List_Table
function
get_bulk_actions
()
function
get_bulk_actions
()
{
{
if
(
current_user_can
(
'
moderate_comments
'
)
)
{
if
(
current_user_can
(
'
houseApproval
'
)
)
{
$actions
=
array
(
$actions
=
array
(
"agree"
=>
"通过"
,
"agree"
=>
"通过"
,
"goBack"
=>
"退回"
"goBack"
=>
"退回"
...
@@ -204,6 +207,8 @@ class secHandHouseList extends WP_List_Table
...
@@ -204,6 +207,8 @@ class secHandHouseList extends WP_List_Table
{
{
$action
=
$this
->
current_action
();
$action
=
$this
->
current_action
();
if
(
$action
)
{
if
(
$action
)
{
global
$wpdb
;
$id
=
$_REQUEST
[
'sechandhouselist'
];
$string
=
null
;
$string
=
null
;
$status
=
null
;
$status
=
null
;
if
(
$action
==
'allot'
){
if
(
$action
==
'allot'
){
...
@@ -211,7 +216,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -211,7 +216,6 @@ class secHandHouseList extends WP_List_Table
}
else
{
}
else
{
switch
(
$action
)
{
switch
(
$action
)
{
case
'unCheck'
:
case
'unCheck'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
0
);
$res
=
$this
->
getCurrentStatus
(
$string
,
0
);
...
@@ -222,7 +226,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -222,7 +226,6 @@ class secHandHouseList extends WP_List_Table
}
}
break
;
break
;
case
'check'
:
case
'check'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
1
);
$res
=
$this
->
getCurrentStatus
(
$string
,
1
);
...
@@ -233,7 +236,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -233,7 +236,6 @@ class secHandHouseList extends WP_List_Table
}
}
break
;
break
;
case
'selfSale'
:
case
'selfSale'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
2
);
$res
=
$this
->
getCurrentStatus
(
$string
,
2
);
...
@@ -244,7 +246,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -244,7 +246,6 @@ class secHandHouseList extends WP_List_Table
}
}
break
;
break
;
case
'otherSale'
:
case
'otherSale'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
3
);
$res
=
$this
->
getCurrentStatus
(
$string
,
3
);
...
@@ -255,7 +256,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -255,7 +256,6 @@ class secHandHouseList extends WP_List_Table
}
}
break
;
break
;
case
'invalid'
:
case
'invalid'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
4
);
$res
=
$this
->
getCurrentStatus
(
$string
,
4
);
...
@@ -266,7 +266,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -266,7 +266,6 @@ class secHandHouseList extends WP_List_Table
}
}
break
;
break
;
case
'reactivation'
:
case
'reactivation'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$sql
=
"select status from tospur_house where id in"
.
$string
;
$sql
=
"select status from tospur_house where id in"
.
$string
;
...
@@ -282,7 +281,6 @@ class secHandHouseList extends WP_List_Table
...
@@ -282,7 +281,6 @@ class secHandHouseList extends WP_List_Table
}
}
break
;
break
;
case
'onSale'
:
case
'onSale'
:
$id
=
$_REQUEST
[
'sechandhouselist'
];
if
(
$id
)
{
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$res
=
$this
->
getCurrentStatus
(
$string
,
-
1
);
$res
=
$this
->
getCurrentStatus
(
$string
,
-
1
);
...
@@ -310,7 +308,7 @@ class secHandHouseList extends WP_List_Table
...
@@ -310,7 +308,7 @@ class secHandHouseList extends WP_List_Table
$sortable
=
$this
->
get_sortable_columns
();
$sortable
=
$this
->
get_sortable_columns
();
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
if
(
current_user_can
(
'
moderate_comments
'
)
)
{
if
(
current_user_can
(
'
houseApproval
'
)
)
{
$this
->
manage_bulk_action
();
$this
->
manage_bulk_action
();
}
else
{
}
else
{
$this
->
process_bulk_action
();
$this
->
process_bulk_action
();
...
@@ -373,7 +371,7 @@ class secHandHouseList extends WP_List_Table
...
@@ -373,7 +371,7 @@ class secHandHouseList extends WP_List_Table
$sql
=
$sql
.
" and name like %s"
;
$sql
=
$sql
.
" and name like %s"
;
}
}
if
(
isset
(
$_REQUEST
[
"approval"
])){
if
(
isset
(
$_REQUEST
[
"approval"
])
&&
$_REQUEST
[
"approval"
]
!=
""
){
if
(
$_REQUEST
[
"approval"
]
==
-
2
){
if
(
$_REQUEST
[
"approval"
]
==
-
2
){
$params
[]
=
$_REQUEST
[
"approval"
];
$params
[]
=
$_REQUEST
[
"approval"
];
$sql
=
$sql
.
" and approval != %d"
;
$sql
=
$sql
.
" and approval != %d"
;
...
...
wp-content/plugins/tospur/Admin/tospur_sale.php
View file @
102311c9
...
@@ -21,7 +21,7 @@ class tospurSaleList extends WP_List_Table
...
@@ -21,7 +21,7 @@ class tospurSaleList extends WP_List_Table
{
{
switch
(
$column_name
)
{
switch
(
$column_name
)
{
case
'community_name'
:
case
'community_name'
:
return
'<a href="'
.
admin_url
(
'admin.php?page='
.
$_GET
[
'page'
]
.
'&id='
.
$item
[
'id'
])
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
return
'<a href="'
.
admin_url
(
'admin.php?page='
.
$_GET
[
'page'
]
.
'&id='
.
$item
[
'id'
]
.
'&cityId='
.
$item
[
'cityId'
]
)
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
case
'consultant'
:
case
'consultant'
:
$consultant
=
$item
[
$column_name
]
?
$item
[
$column_name
]
:
'未分配'
;
$consultant
=
$item
[
$column_name
]
?
$item
[
$column_name
]
:
'未分配'
;
return
$consultant
;
return
$consultant
;
...
@@ -113,10 +113,13 @@ class tospurSaleList extends WP_List_Table
...
@@ -113,10 +113,13 @@ class tospurSaleList extends WP_List_Table
}
else
if
(
$house_type
==
'tospur_sale_rent'
)
{
}
else
if
(
$house_type
==
'tospur_sale_rent'
)
{
$house_type
=
2
;
$house_type
=
2
;
}
}
$sql
=
"SELECT ts.*,dc.cityName,
u.display
_name FROM tospur_sale ts"
.
$sql
=
"SELECT ts.*,dc.cityName,
tc.name as consultant
_name FROM tospur_sale ts"
.
" left join (SELECT cityId,cityName FROM dic_city group by cityId) dc on ts.cityId = dc.cityId"
.
" left join (SELECT cityId,cityName FROM dic_city group by cityId) dc on ts.cityId = dc.cityId"
.
" left join
wp_users u on u.ID
= ts.consultant_id"
.
" left join
tospur_consultant tc on tc.id
= ts.consultant_id"
.
" where ts.house_type = "
.
$house_type
;
" where ts.house_type = "
.
$house_type
;
if
(
!
current_user_can
(
'fdfw_allot'
))
{
$sql
.=
" and tc.id = "
.
get_current_user_id
();
}
$cityId
=
(
int
)
$_GET
[
'cityId'
];
$cityId
=
(
int
)
$_GET
[
'cityId'
];
if
(
$cityId
>
0
)
{
if
(
$cityId
>
0
)
{
$sql
.=
" and ts.cityId = "
.
$cityId
;
$sql
.=
" and ts.cityId = "
.
$cityId
;
...
@@ -131,6 +134,7 @@ class tospurSaleList extends WP_List_Table
...
@@ -131,6 +134,7 @@ class tospurSaleList extends WP_List_Table
$unit
=
(
$value
->
house_type
==
1
)
?
'万元'
:
'元/月'
;
$unit
=
(
$value
->
house_type
==
1
)
?
'万元'
:
'元/月'
;
$data
[
$key
]
=
array
(
$data
[
$key
]
=
array
(
'id'
=>
$value
->
id
,
'id'
=>
$value
->
id
,
'cityId'
=>
$value
->
cityId
,
'cityName'
=>
$value
->
cityName
,
'cityName'
=>
$value
->
cityName
,
'community_name'
=>
$value
->
community_name
,
'community_name'
=>
$value
->
community_name
,
'apartment'
=>
$value
->
bedroom
.
'室'
.
$value
->
hall
.
'厅'
.
$value
->
kitchen
.
'厨'
.
$value
->
bathroom
.
'卫'
,
'apartment'
=>
$value
->
bedroom
.
'室'
.
$value
->
hall
.
'厅'
.
$value
->
kitchen
.
'厨'
.
$value
->
bathroom
.
'卫'
,
...
@@ -141,7 +145,7 @@ class tospurSaleList extends WP_List_Table
...
@@ -141,7 +145,7 @@ class tospurSaleList extends WP_List_Table
'description'
=>
$value
->
description
,
'description'
=>
$value
->
description
,
'phone'
=>
$value
->
phone
,
'phone'
=>
$value
->
phone
,
'submission_date'
=>
$value
->
submission_date
,
'submission_date'
=>
$value
->
submission_date
,
'consultant'
=>
$value
->
display
_name
,
'consultant'
=>
$value
->
consultant
_name
,
'handle'
=>
$value
->
handle
,
'handle'
=>
$value
->
handle
,
'handle_date'
=>
$value
->
handle_date
'handle_date'
=>
$value
->
handle_date
);
);
...
@@ -173,15 +177,6 @@ class tospurSaleList extends WP_List_Table
...
@@ -173,15 +177,6 @@ class tospurSaleList extends WP_List_Table
}
}
}
}
function
add_tospur_sale_menu
()
{
add_menu_page
(
'房东服务'
,
'房东服务'
,
'activate_plugins'
,
'tospur_sale_secondhand'
,
'tospur_sale_page'
,
'dashicons-menu'
,
28
);
add_submenu_page
(
'tospur_sale_secondhand'
,
'出售'
,
'出售'
,
'activate_plugins'
,
'tospur_sale_secondhand'
,
'tospur_sale_page'
);
add_submenu_page
(
'tospur_sale_secondhand'
,
'出租'
,
'出租'
,
'activate_plugins'
,
'tospur_sale_rent'
,
'tospur_sale_page'
);
}
add_action
(
'admin_menu'
,
'add_tospur_sale_menu'
);
function
tospur_sale_page
()
function
tospur_sale_page
()
{
{
if
(
$_GET
[
'id'
])
{
if
(
$_GET
[
'id'
])
{
...
...
wp-content/plugins/tospur/Admin/tospur_sale_detail.php
View file @
102311c9
...
@@ -8,22 +8,53 @@ if ($page == 'tospur_sale_secondhand') {
...
@@ -8,22 +8,53 @@ if ($page == 'tospur_sale_secondhand') {
}
else
if
(
$page
==
'tospur_sale_rent'
)
{
}
else
if
(
$page
==
'tospur_sale_rent'
)
{
$house_type
=
2
;
$house_type
=
2
;
}
}
$detail_sql
=
"SELECT ts.*,dc.cityName,u.display_name FROM tospur_sale ts"
.
$role_flag
=
current_user_can
(
'fdfw_allot'
);
global
$wpdb
;
if
(
isset
(
$_POST
[
'submit'
])
&&
$role_flag
)
{
$consultant_id
=
$_POST
[
'data'
][
'recConsultant'
][
0
];
if
(
isset
(
$consultant_id
)
&&
$consultant_id
!=
null
)
{
$wpdb
->
update
(
'tospur_sale'
,
array
(
'consultant_id'
=>
$consultant_id
),
array
(
'id'
=>
$house_id
)
);
}
else
{
echo
'<script>alert("请选择置业顾问")</script>'
;
}
}
else
if
(
isset
(
$_POST
[
'handle'
])
&&
!
$role_flag
)
{
$wpdb
->
update
(
'tospur_sale'
,
array
(
'handle'
=>
1
,
'handle_date'
=>
current_time
(
'Y-m-d H:i:s'
),
),
array
(
'id'
=>
$house_id
)
);
}
$detail_sql
=
"SELECT ts.*,dc.cityName,tc.id as consultant_id,tc.imageUrl,tc.name as consultant_name FROM tospur_sale ts"
.
" left join (SELECT cityId,cityName FROM dic_city group by cityId) dc on ts.cityId = dc.cityId"
.
" left join (SELECT cityId,cityName FROM dic_city group by cityId) dc on ts.cityId = dc.cityId"
.
" left join
wp_users u on u.ID
= ts.consultant_id"
.
" left join
tospur_consultant tc on tc.id
= ts.consultant_id"
.
" where ts.house_type = "
.
$house_type
.
" and ts.id = "
.
$house_id
;
" where ts.house_type = "
.
$house_type
.
" and ts.id = "
.
$house_id
;
$consultant_sql
=
'SELECT u.id,u.display_name FROM wp_users u '
$result
=
$wpdb
->
get_row
(
$detail_sql
);
.
'left join wp_usermeta m on u.id=m.user_id where meta_key="wp_user_level" and meta_value=7;'
;
global
$wpdb
;
if
(
$result
->
consultant_id
&&
$role_flag
)
{
$context
[
'consultant'
][
0
]
=
array
(
$context
[
'detail_result'
]
=
$wpdb
->
get_row
(
$detail_sql
);
'id'
=>
$result
->
consultant_id
,
$context
[
'consultant_result'
]
=
$wpdb
->
get_results
(
$consultant_sql
);
'imageUrl'
=>
$result
->
imageUrl
,
'name'
=>
$result
->
consultant_name
);
}
$context
[
'detail_result'
]
=
$result
;
$context
[
'url'
]
=
home_url
();
$context
[
'url'
]
=
home_url
();
$context
[
'id'
]
=
$house_id
;
$context
[
'id'
]
=
$house_id
;
$context
[
'cityId'
]
=
$_GET
[
'cityId'
];
$context
[
'house_type'
]
=
$house_type
;
$context
[
'house_type'
]
=
$house_type
;
$context
[
'city'
]
=
SearchDao
::
searchCity
();
$context
[
'role_flag'
]
=
$role_flag
;
if
(
!
$role_flag
)
{
$context
[
'handle'
]
=
(
integer
)
$result
->
handle
;
}
Timber
::
render
(
'sale_detail.html'
,
$context
);
Timber
::
render
(
'sale_detail.html'
,
$context
);
...
...
wp-content/plugins/tospur/Admin/view_house.php
View file @
102311c9
...
@@ -127,13 +127,6 @@ class viewHouseList extends WP_List_Table
...
@@ -127,13 +127,6 @@ class viewHouseList extends WP_List_Table
}
}
}
}
function
add_view_house_menu
()
{
add_menu_page
(
'预约列表'
,
'预约列表'
,
'moderate_comments'
,
'view_house'
,
'view_house_page'
,
'dashicons-menu'
,
27
);
}
add_action
(
'admin_menu'
,
'add_view_house_menu'
);
function
view_house_page
()
function
view_house_page
()
{
{
if
(
$_GET
[
'id'
])
{
if
(
$_GET
[
'id'
])
{
...
...
wp-content/plugins/tospur/Admin/views/contract.html
View file @
102311c9
...
@@ -227,6 +227,13 @@
...
@@ -227,6 +227,13 @@
<br/>
<br/>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<div
class=
"col-md-8"
>
<label
for=
"buy[mtime]"
>
应收时间:
</label>
<input
name=
"buy[mtime]"
type=
"text"
class=
"form-control"
{%
if
commission
[
0
]
%}
value =
"{{commission[0].mtime}}"
readonly
{%
endif
%}
>
</div>
</div>
<br/>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<button
type=
"button"
class=
"button action"
id=
"paid_buy"
>
<button
type=
"button"
class=
"button action"
id=
"paid_buy"
>
添加实收佣金
添加实收佣金
</button>
</button>
...
@@ -317,6 +324,13 @@
...
@@ -317,6 +324,13 @@
<br/>
<br/>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<div
class=
"col-md-8"
>
<label
for=
"sell[mtime]"
>
应收时间:
</label>
<input
name=
"sell[mtime]"
type=
"text"
class=
"form-control"
{%
if
commission
[
1
]
%}
value =
"{{commission[1].mtime}}"
readonly
{%
endif
%}
>
</div>
</div>
<br/>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<button
type=
"button"
class=
"button action"
id=
"paid_sell"
>
<button
type=
"button"
class=
"button action"
id=
"paid_sell"
>
添加实收佣金
添加实收佣金
</button>
</button>
...
...
wp-content/plugins/tospur/Admin/views/introduction.html
View file @
102311c9
<h2>
诚信宣言
</h2>
<style>
<label
for=
"introduction"
>
p
{
<textarea
id=
"introduction"
placeholder=
"请输入诚信宣言"
rows=
"10"
cols=
"50"
style=
"resize: none;"
>
{{ introduction }}
</textarea>
font-size
:
15px
;
</label>
margin
:
20px
0
;
}
</style>
<h2>
我的设置
</h2>
<p>
<label
for=
"time"
>
入职时间:
</label>
<input
type=
"date"
id=
"time"
value=
"{{ time }}"
>
</p>
<p>
<label
for=
"introduction"
style=
"vertical-align: top;"
>
诚信宣言:
</label>
<textarea
id=
"introduction"
placeholder=
"请输入诚信宣言"
rows=
"10"
cols=
"50"
style=
"resize: none;"
>
{{ introduction }}
</textarea>
</p>
<p>
<p>
<input
type=
"hidden"
id=
"user_id"
value=
"{{ user_id }}"
>
<input
type=
"hidden"
id=
"user_id"
value=
"{{ user_id }}"
>
<input
type=
"submit"
id=
"submit"
class=
"button"
>
<input
type=
"submit"
id=
"submit"
class=
"button"
>
</p>
</p>
<script>
<script>
(
function
(
$
)
{
(
function
(
$
)
{
var
oldIntroduction
=
'{{ introduction }}'
;
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'#submit'
).
click
(
function
()
{
$
(
'#submit'
).
click
(
function
()
{
var
introduction
=
$
(
'#introduction'
).
val
();
var
introduction
=
$
(
'#introduction'
).
val
();
var
time
=
$
(
'#time'
).
val
();
var
user_id
=
$
(
'#user_id'
).
val
();
var
user_id
=
$
(
'#user_id'
).
val
();
if
(
introduction
.
trim
()
!=
''
&&
oldIntroduction
!=
introduction
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
data
:
'action=submit_introduction&time='
+
time
+
'&introduction='
+
introduction
+
'&user_id='
+
user_id
,
data
:
'action=submit_introduction&introduction='
+
introduction
+
'&user_id='
+
user_id
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
)
{
if
(
data
)
{
alert
(
'提交成功'
);
alert
(
'提交成功'
);
}
}
}
});
}
}
else
{
});
alert
(
'请修改诚信宣言'
);
}
});
});
});
});
})(
jQuery
);
})(
jQuery
);
...
...
wp-content/plugins/tospur/Admin/views/listBlock.html
View file @
102311c9
...
@@ -5,92 +5,96 @@
...
@@ -5,92 +5,96 @@
<br
/>
<br
/>
{% include 'selectOrganization.html' %}
{% include 'selectOrganization.html' %}
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input
type=
"hidden"
name=
"page"
value=
"{{page}}"
/>
<div
style=
"margin-bottom: 10px;"
>
<select
id=
"listCity"
name=
"listCity"
class=
"form-control"
>
<input
type=
"hidden"
name=
"page"
value=
"{{page}}"
/>
<option
value=
"-1"
>
城市
</option>
<select
id=
"listCity"
name=
"listCity"
class=
"form-control"
>
{% for item in city %}
<option
value=
"-1"
>
城市
</option>
<option
{{
item
.
id =
=
cityId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% for item in city %}
{% endfor %}
<option
{{
item
.
id =
=
cityId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
</select>
{% endfor %}
<select
id=
"listDistrict"
name=
"listDistrict"
class=
"form-control"
>
</select>
<option
value=
"-1"
>
区域
</option>
<select
id=
"listDistrict"
name=
"listDistrict"
class=
"form-control"
>
{% if district %}
<option
value=
"-1"
>
区域
</option>
{% for item in district %}
{% if district %}
<option
{{
item
.
id =
=
districtId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% for item in district %}
{% endfor %}
<option
{{
item
.
id =
=
districtId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
<select
id=
"listPlate"
name=
"listPlate"
class=
"form-control"
>
<option
value=
"-1"
>
板块
</option>
{% if plate %}
{% for item in plate %}
<option
{{
item
.
id =
=
plateId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
{% if house_type == 2%}
<select
id=
"rentalPrice"
name=
"rentalPrice"
class=
"form-control"
>
<option
value =
""
>
租金
</option>
{% if dicRentalPrice %}
{% for item in dicRentalPrice %}
<option
{{
item
.
value =
=
rentalPrice
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
{% elseif house_type == 0 %}
<select
id=
"averagePrice"
name=
"averagePrice"
class=
"form-control"
>
<option
value =
""
>
单价
</option>
<!--<option {{ item.value == average_price ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>-->
</select>
{% else%}
<select
id=
"totalPrice"
name=
"totalPrice"
class=
"form-control"
>
<option
value =
""
>
价格
</option>
{% if dicTotalPrice %}
{% for item in dicTotalPrice %}
<option
{{
item
.
value =
=
totalPrice
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endif %}
</select>
{% endif %}
{% endif %}
</select>
{% if house_type == 0%}
<select
id=
"listPlate"
name=
"listPlate
"
class=
"form-control"
>
<select
id=
"room"
name=
"room
"
class=
"form-control"
>
<option
value=
"-1"
>
板块
</option>
<option
value=
"-1"
>
类型
</option>
{% if plate
%}
{% for item in room
%}
{% for item in plate %}
<option
{{
item
.
id =
=
roomId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
<option
{{
item
.
id =
=
plateId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
{% endfor %}
</select>
{% endif %}
{% endif %}
</select>
<select
id=
"buildProperty"
name=
"buildProperty"
class=
"form-control"
>
{% if house_type == 2%}
<option
value=
"-1"
>
房型
</option>
<select
id=
"rentalPrice"
name=
"rentalPrice"
class=
"form-control"
>
{% for item in buildProperty %}
<option
value =
""
>
租金
</option>
<option
{{
item
.
id =
=
buildPropertyId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% if dicRentalPrice %}
{% endfor %}
{% for item in dicRentalPrice %}
</select>
<option
{{
item
.
value =
=
rentalPrice
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
<select
id=
"acreage"
name=
"acreage"
class=
"form-control"
>
{% endfor %}
<option
value =
""
>
面积
</option>
{% endif %}
{% if acreage %}
</select>
{% for item in dicArea %}
{% elseif house_type == 0 %}
<option
{{
item
.
value =
=
acreage
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
<select
id=
"averagePrice"
name=
"averagePrice"
class=
"form-control"
>
{% endfor %}
<option
value =
""
>
单价
</option>
{% endif %}
<!--<option {{ item.value == average_price ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>-->
</select>
</select>
<select
name=
"status"
name=
"status"
class=
"form-control"
>
{% else%}
<option
value=
"-1"
>
状态
</option>
<select
id=
"totalPrice"
name=
"totalPrice"
class=
"form-control"
>
{% for item in status%}
<option
value =
""
>
价格
</option>
<option
{{
item
.
id =
=
statusId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% if dicTotalPrice %}
{% endfor %}
{% for item in dicTotalPrice %}
</select>
<option
{{
item
.
value =
=
totalPrice
?"
selected
"
:
""
}}
value=
"{{ item.value }}"
>
{{ item.value }}
</option>
</div>
{% endfor %}
<div
id=
"organization"
style=
"margin-bottom: 10px;"
>
{% endif %}
<label
for=
"endDate"
>
楼盘名:
</label>
</select>
<input
type=
"text"
name=
"searchText"
class=
"form-control"
>
{% endif %}
<label
for=
"beginDate"
>
开始日期:
</label>
{% if house_type == 0%}
<input
type=
"date"
name=
"beginDate"
class=
"form-control"
{%
if
req
%}
value=
"{{req.beginDate}}"
{%
endif
%}
>
<select
id=
"room"
name=
"room"
class=
"form-control"
>
<label
for=
"endDate"
>
结束日期:
</label>
<option
value=
"-1"
>
类型
</option>
<input
type=
"date"
name=
"endDate"
class=
"form-control"
{%
if
req
%}
value=
"{{req.endDate}}"
{%
endif
%}
>
{% for item in room %}
<label
for=
"stuff"
>
员工:
</label>
<option
{{
item
.
id =
=
roomId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
<input
type=
"text"
name=
"stuff"
class=
"form-control"
{%
if
req
%}
value=
"{{req.stuff}}"
{%
endif
%}
>
{% endfor %}
<input
type=
"hidden"
name=
"hasSearch"
value=
"1"
/>
</select>
<input
type=
"hidden"
id=
"house_type"
value=
"{{house_type}}"
/>
{% endif %}
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"搜索"
>
<select
id=
"buildProperty"
name=
"buildProperty"
class=
"form-control"
>
</div>
<option
value=
"-1"
>
房型
</option>
{% for item in buildProperty %}
<option
{{
item
.
id =
=
buildPropertyId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<select
id=
"acreage"
name=
"acreage"
class=
"form-control"
>
<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"
class=
"form-control"
>
<option
value=
"-1"
>
状态
</option>
{% for item in status%}
<option
{{
item
.
id =
=
statusId
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<input
type=
"text"
placeholder=
"请出入楼盘名"
name=
"searchText"
class=
"form-control"
>
<br
/>
<label
for=
"beginDate"
>
开始日期:
</label>
<input
type=
"date"
name=
"beginDate"
class=
"form-control"
{%
if
req
%}
value=
"{{req.beginDate}}"
{%
endif
%}
>
<label
for=
"endDate"
>
结束日期:
</label>
<input
type=
"date"
name=
"endDate"
class=
"form-control"
{%
if
req
%}
value=
"{{req.endDate}}"
{%
endif
%}
>
<label
for=
"stuff"
>
员工:
</label>
<input
type=
"text"
name=
"stuff"
class=
"form-control"
{%
if
req
%}
value=
"{{req.stuff}}"
{%
endif
%}
>
<input
type=
"hidden"
name=
"hasSearch"
value=
"1"
/>
<input
type=
"hidden"
id=
"house_type"
value=
"{{house_type}}"
/>
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"搜索"
>
</form>
</form>
<form
method=
"post"
>
<form
method=
"post"
>
<!-- Now we can render the completed list table -->
<!-- Now we can render the completed list table -->
...
...
wp-content/plugins/tospur/Admin/views/newhouse.html
View file @
102311c9
...
@@ -62,16 +62,25 @@
...
@@ -62,16 +62,25 @@
</div>
</div>
<div
class=
"col-xs-2"
>
<div
class=
"col-xs-2"
>
<div
class=
"row"
style=
"position: fixed;top:200px;"
>
<div
class=
"row"
style=
"position: fixed;top:200px;"
>
{% if (role == 'administrator'or role =='eidtor') %}
{% if houseId %}
<select
id=
"status"
name=
"status"
class=
"form-control"
>
{% if canApproval %}
{% if result.approval != -2 %}
<select
name=
"status"
class=
"form-control"
>
<option
value=
"{{result.approval}}"
>
通过
</option>
<option
value=
"-2"
>
退回
</option>
</select>
<input
type=
"hidden"
name=
"userType"
value=
"0"
>
{% endif %}
{% else %}
<select
name=
"status"
class=
"form-control"
>
{% for item in status %}
{% for item in status %}
<option
{{
item
.
id =
=
result
.
status
?"
selected
"
:
""
}}
value=
{{item.id}}
>
{{item.value}}
</option>
<option
{{
item
.
id =
=
result
.
status
?"
selected
"
:
""
}}
value=
{{item.id}}
>
{{item.value}}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
{% else %}
<input
type=
"hidden"
name=
"userType"
value=
"{{houseId}}"
>
<input
type=
"hidden"
name=
"status"
value=
"0"
>
{% endif %}
{% endif %}
{% endif %}
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"
position: fixed;top:155px
"
>
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"
float:left
"
>
</div>
</div>
</div>
</div>
...
@@ -128,6 +137,7 @@
...
@@ -128,6 +137,7 @@
community_name
:
'请输入小区名称'
,
community_name
:
'请输入小区名称'
,
address
:
'请输入地址'
,
address
:
'请输入地址'
,
average_price
:
'请输入均价'
,
average_price
:
'请输入均价'
,
description
:
'请输入跟进说明'
description
:
'请输入跟进说明'
},
},
errorContainer
:
"#messageBox1"
,
errorContainer
:
"#messageBox1"
,
...
@@ -137,8 +147,12 @@
...
@@ -137,8 +147,12 @@
alert
(
"请选择房源相册"
);
alert
(
"请选择房源相册"
);
return
false
;
return
false
;
}
}
if
(
$
(
"#houseImg > p"
).
length
==
0
){
if
(
$
(
"#consultantImg > p"
).
length
==
0
){
alert
(
"请选择推荐房源"
);
alert
(
"请选择置业顾问"
);
return
false
;
}
if
(
$
(
"#photosTbody > tr"
).
length
==
0
){
alert
(
"请选择房源相册"
);
return
false
;
return
false
;
}
}
form
.
submit
();
form
.
submit
();
...
...
wp-content/plugins/tospur/Admin/views/rentHouse.html
View file @
102311c9
...
@@ -50,15 +50,26 @@
...
@@ -50,15 +50,26 @@
{% endif %}
{% endif %}
</div>
</div>
<div
class=
"col-xs-2"
>
<div
class=
"col-xs-2"
>
<div
class=
"row"
style=
"position: fixed;top:200px;"
>
<div
class=
"row"
style=
"position: fixed;"
>
{% if (role == 'administrator'or role =='eidtor') %}
{% if houseId %}
<select
id=
"status"
name=
"status"
>
{% if canApproval %}
{% for item in status %}
{% if result.approval != -2 %}
<option
{{
item
.
id =
=
result
.
status
?"
selected
"
:
""
}}
value=
{{item.id}}
>
{{item.value}}
</option>
<select
name=
"status"
class=
"form-control"
>
{% endfor %}
<option
value=
"{{result.approval}}"
>
通过
</option>
</select>
<option
value=
"-2"
>
退回
</option>
</select>
<input
type=
"hidden"
name=
"userType"
value=
"0"
>
{% endif %}
{% endif %}
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"position: fixed;top:155px"
>
{% else %}
<select
name=
"status"
class=
"form-control"
>
{% for item in status %}
<option
{{
item
.
id =
=
result
.
status
?"
selected
"
:
""
}}
value=
{{item.id}}
>
{{item.value}}
</option>
{% endfor %}
</select>
<input
type=
"hidden"
name=
"userType"
value=
"{{houseId}}"
>
{% endif %}
{% endif %}
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"float:left"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
wp-content/plugins/tospur/Admin/views/sale_detail.html
View file @
102311c9
<style>
<style>
.sale_detail
ul
{
.sale_detail
ul
{
margin-top
:
30px
;
margin-top
:
30px
;
}
}
.sale_detail
ul
li
{
.sale_detail
ul
li
{
margin
:
20px
0
;
margin
:
20px
0
;
}
}
.sale_detail
ul
li
span
:nth-of-type
(
1
)
{
.sale_detail
ul
li
span
:nth-of-type
(
1
)
{
font-weight
:
bold
;
font-weight
:
bold
;
font-size
:
14px
;
font-size
:
14px
;
display
:
inline-block
;
display
:
inline-block
;
width
:
100px
;
width
:
100px
;
}
}
.sale_detail
ul
li
span
:nth-of-type
(
2
)
{
.sale_detail
ul
li
span
:nth-of-type
(
2
)
{
font-size
:
14px
;
font-size
:
14px
;
display
:
inline-block
;
display
:
inline-block
;
width
:
400px
;
width
:
400px
;
}
}
</style>
</style>
<script>
<script>
(
function
(
$
)
{
(
function
(
$
)
{
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'#handle'
).
click
(
function
()
{
$
(
'#handle'
).
click
(
function
()
{
var
consultant_id
=
$
(
'#consultant'
).
find
(
'option:selected'
).
val
();
var
consultant_id
=
$
(
'#consultant'
).
find
(
'option:selected'
).
val
();
alert
(
consultant_id
);
alert
(
consultant_id
);
});
});
});
});
})(
jQuery
);
})(
jQuery
);
</script>
</script>
{% if house_type == 1 %}
{% if house_type == 1 %}
{% set unit = '万元' %}
{% set unit = '万元' %}
{% set price = '售价' %}
{% set price = '售价' %}
{% elseif house_type == 2 %}
{% elseif house_type == 2 %}
{% set unit = '元/月' %}
{% set unit = '元/月' %}
{% set price = '租金' %}
{% set price = '租金' %}
{% endif %}
{% endif %}
<div
class=
"sale_detail"
>
<form
method=
"post"
>
<h2>
房东服务详细
</h2>
<div
class=
"sale_detail"
>
<ul>
<h2>
房东服务详细
</h2>
<li>
<ul>
<span>
城市:
</span>
<li>
<span>
{{ detail_result.cityName }}
</span>
<span>
城市:
</span>
</li>
<span>
{{ detail_result.cityName }}
</span>
<li>
</li>
<span>
小区名称:
</span>
<li>
<span>
{{ detail_result.community_name }}
</span>
<span>
小区名称:
</span>
</li>
<span>
{{ detail_result.community_name }}
</span>
<li>
</li>
<span>
户型:
</span>
<li>
<span>
{{ detail_result.bedroom }}室{{ detail_result.hall }}厅{{ detail_result.kitchen }}厨{{ detail_result.bathroom }}卫
</span>
<span>
户型:
</span>
</li>
<span>
{{ detail_result.bedroom }}室{{ detail_result.hall }}厅{{ detail_result.kitchen }}厨{{ detail_result.bathroom }}卫
</span>
<li>
</li>
<span>
面积:
</span>
<li>
<span>
{{ detail_result.covered_area }}m²
</span>
<span>
面积:
</span>
</li>
<span>
{{ detail_result.covered_area }}m²
</span>
<li>
</li>
<span>
楼层:
</span>
<li>
<span>
第{{ detail_result.floor }}层(共{{ detail_result.total_floor }}层)
</span>
<span>
楼层:
</span>
</li>
<span>
第{{ detail_result.floor }}层(共{{ detail_result.total_floor }}层)
</span>
<li>
</li>
<span>
期望{{ price }}:
</span>
<li>
<span>
{{ detail_result.price }}{{ unit }}
</span>
<span>
期望{{ price }}:
</span>
</li>
<span>
{{ detail_result.price }}{{ unit }}
</span>
<li>
</li>
<span>
房源描述:
</span>
<li>
<span>
{{ detail_result.description }}
</span>
<span>
房源描述:
</span>
</li>
<span>
{{ detail_result.description }}
</span>
<li>
</li>
<span>
置业顾问:
</span>
</ul>
<span>
{% if role_flag %}
<select
id=
"consultant"
>
{% include 'addConsultant.html' %}
{% for consultant in consultant_result %}
<input
type=
"hidden"
name=
"submit"
value=
"1"
>
<option
value=
"{{ consultant.id }}"
{%
if
(
house_result
.
consultant_id =
=
consultant
.
id
)
%}
selected=
"selected"
{%
endif
%}
>
{{ consultant.display_name }}
</option>
<input
type=
"hidden"
id=
"baseCity"
value=
"{{ cityId }}"
>
{% endfor %}
{% include 'recConsultant.html' %}
</select>
{{ block('recConsultant') }}
<label
for=
"consultant"
></label>
{% else %}
</span>
<input
type=
"hidden"
name=
"handle"
value=
"1"
>
</li>
{% endif %}
</ul>
{% if handle == 0 %}
</div>
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"提交处理"
>
<button
id=
"handle"
>
提交处理
</button>
{% endif %}
\ No newline at end of file
</div>
</form>
\ No newline at end of file
wp-content/plugins/tospur/Admin/views/secHandHouse.html
View file @
102311c9
...
@@ -55,15 +55,25 @@
...
@@ -55,15 +55,25 @@
</div>
</div>
<div
class=
"col-xs-2"
>
<div
class=
"col-xs-2"
>
<div
class=
"row"
style=
"position: fixed;top:200px;"
>
<div
class=
"row"
style=
"position: fixed;top:200px;"
>
{% if (role == 'administrator'or role =='eidtor') %}
{% if houseId %}
<select
id=
"status"
name=
"status"
class=
"form-control"
>
{% if canApproval %}
{% if result.approval != -2 %}
<select
name=
"status"
class=
"form-control"
>
<option
value=
"{{result.approval}}"
>
通过
</option>
<option
value=
"-2"
>
退回
</option>
</select>
<input
type=
"hidden"
name=
"userType"
value=
"0"
>
{% endif %}
{% else %}
<select
name=
"status"
class=
"form-control"
>
{% for item in status %}
{% for item in status %}
<option
{{
item
.
id =
=
result
.
status
?"
selected
"
:
""
}}
value=
{{item.id}}
>
{{item.value}}
</option>
<option
{{
item
.
id =
=
result
.
status
?"
selected
"
:
""
}}
value=
{{item.id}}
>
{{item.value}}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
{% else %}
<input
type=
"hidden"
name=
"userType"
value=
"{{houseId}}"
>
<input
type=
"hidden"
name=
"status"
value=
"0"
>
{% endif %}
{% endif %}
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"position: fixed;top:155px"
>
{% endif %}
<input
type=
"submit"
id=
"submit"
class=
"button action"
style=
"float:left"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
wp-content/plugins/tospur/Admin/views/selectOrganization.html
View file @
102311c9
{% set organization = function('SearchDao::searchOrganization')|json_encode() %}
{% set organization = function('SearchDao::searchOrganization')|json_encode() %}
<div
id=
"organization"
style=
"margin-bottom: 10px;"
>
<div
id=
"organization"
style=
"margin-bottom: 10px;"
>
<
span>
门店
</span
>
<
label>
部门:
</label
>
<label
for=
"depth_1"
class=
"hidden"
></label>
<label
for=
"depth_1"
class=
"hidden"
></label>
<select
data-depth=
"1"
id=
"depth_1"
>
<select
data-depth=
"1"
id=
"depth_1"
>
<option
value=
"-1"
>
请选择
</option>
<option
value=
"-1"
>
请选择
</option>
...
...
wp-content/plugins/tospur/Dao/CustomerDao.php
View file @
102311c9
...
@@ -46,6 +46,18 @@ class CustomerDao
...
@@ -46,6 +46,18 @@ class CustomerDao
$result
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
$sql
,
$search
,
$search
));
$result
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
$sql
,
$search
,
$search
));
wp_send_json
(
$result
);
wp_send_json
(
$result
);
}
}
public
static
function
updateCustomerStatue
(
$id
,
$status
){
global
$wpdb
;
$result
=
$wpdb
->
update
(
Config
::
TOSPUR_CUSTOMER_TABLE
,
array
(
'status'
=>
$status
,
),
array
(
'id'
=>
$id
));
if
(
$wpdb
->
last_error
)
return
$wpdb
->
last_error
;
return
$result
;
}
}
}
?>
?>
\ No newline at end of file
wp-content/plugins/tospur/Dao/InsertDao.php
View file @
102311c9
...
@@ -3,16 +3,15 @@
...
@@ -3,16 +3,15 @@
class
InsertDao
{
class
InsertDao
{
public
static
function
insert_tospur_house
(
$params
){
public
static
function
insert_tospur_house
(
$params
){
global
$wpdb
;
global
$wpdb
;
$houseRes
=
$wpdb
->
insert
(
Config
::
TOSPUR_HOUSE_TABLE
,
$params
);
$wpdb
->
insert
(
Config
::
TOSPUR_HOUSE_TABLE
,
$params
);
if
(
$wpdb
->
last_error
){
return
$wpdb
->
last_error
;
}
$houseId
=
$wpdb
->
insert_id
;
$houseId
=
$wpdb
->
insert_id
;
if
(
!
InsertDao
::
setHouseNumber
(
$houseId
,
$params
[
'house_type'
],
$params
[
'city_id'
])){
if
(
!
InsertDao
::
setHouseNumber
(
$houseId
,
$params
[
'house_type'
],
$params
[
'city_id'
])){
return
"房源代码生成失败"
;
return
"房源代码生成失败"
;
}
}
if
(
$houseRes
){
return
$houseId
;
return
$houseId
;
}
else
{
return
$wpdb
->
last_error
;
}
}
}
public
static
function
setHouseNumber
(
$houseId
,
$houseType
,
$cityId
){
public
static
function
setHouseNumber
(
$houseId
,
$houseType
,
$cityId
){
...
@@ -41,52 +40,47 @@ class InsertDao{
...
@@ -41,52 +40,47 @@ class InsertDao{
public
static
function
insert_tospur_image
(
$params
){
public
static
function
insert_tospur_image
(
$params
){
global
$wpdb
;
global
$wpdb
;
$imgRes
=
$wpdb
->
insert
(
Config
::
TOSPUR_IMAGE_TABLE
,
$params
);
$wpdb
->
insert
(
Config
::
TOSPUR_IMAGE_TABLE
,
$params
);
$imgId
=
$wpdb
->
insert_id
;
if
(
$wpdb
->
last_error
){
if
(
$imgRes
){
return
$imgId
;
}
else
{
return
$wpdb
->
last_error
;
return
$wpdb
->
last_error
;
}
}
$imgId
=
$wpdb
->
insert_id
;
return
$imgId
;
}
}
public
static
function
insert_a_district_area
(
$params
){
public
static
function
insert_a_district_area
(
$params
){
global
$wpdb
;
global
$wpdb
;
$districtAreaRes
=
$wpdb
->
insert
(
Config
::
A_DISTRICT_AREA_TABLE
,
$params
);
$wpdb
->
insert
(
Config
::
A_DISTRICT_AREA_TABLE
,
$params
);
if
(
$districtAreaRes
){
if
(
$wpdb
->
last_error
){
return
$districtAreaRes
;
}
else
{
return
$wpdb
->
last_error
;
return
$wpdb
->
last_error
;
}
}
return
$wpdb
->
insert_id
;
}
}
public
static
function
insert_a_house_image
(
$params
){
public
static
function
insert_a_house_image
(
$params
){
global
$wpdb
;
global
$wpdb
;
$houseImageRes
=
$wpdb
->
insert
(
Config
::
A_HOUSE_IMAGE_TABLE
,
$params
);
$wpdb
->
insert
(
Config
::
A_HOUSE_IMAGE_TABLE
,
$params
);
if
(
$houseImageRes
){
if
(
$wpdb
->
last_error
){
return
$houseImageRes
;
}
else
{
return
$wpdb
->
last_error
;
return
$wpdb
->
last_error
;
}
}
return
$wpdb
->
insert_id
;
}
}
public
static
function
insert_a_house_recommend
(
$params
){
public
static
function
insert_a_house_recommend
(
$params
){
global
$wpdb
;
global
$wpdb
;
$houseImageRes
=
$wpdb
->
insert
(
Config
::
A_HOUSE_RECOMMEND_TABLE
,
$params
);
$wpdb
->
insert
(
Config
::
A_HOUSE_RECOMMEND_TABLE
,
$params
);
if
(
$houseImageRes
){
if
(
$wpdb
->
last_error
){
return
$houseImageRes
;
}
else
{
return
$wpdb
->
last_error
;
return
$wpdb
->
last_error
;
}
}
return
$wpdb
->
insert_id
;
}
}
public
static
function
insert_a_house_user
(
$params
){
public
static
function
insert_a_house_user
(
$params
){
global
$wpdb
;
global
$wpdb
;
$houseUserRes
=
$wpdb
->
insert
(
Config
::
A_HOUSE_USER_TABLE
,
$params
);
$wpdb
->
insert
(
Config
::
A_HOUSE_USER_TABLE
,
$params
);
if
(
$houseUserRes
){
if
(
$wpdb
->
last_error
){
return
$houseUserRes
;
}
else
{
return
$wpdb
->
last_error
;
return
$wpdb
->
last_error
;
}
}
return
$wpdb
->
insert_id
;
}
}
public
static
function
addMainImage
(
$houseId
,
$data
){
public
static
function
addMainImage
(
$houseId
,
$data
){
...
@@ -94,6 +88,7 @@ class InsertDao{
...
@@ -94,6 +88,7 @@ class InsertDao{
//图片信息
//图片信息
$uploadedfile
=
$_FILES
[
'files'
];
$uploadedfile
=
$_FILES
[
'files'
];
$frontCover
=
$_POST
[
"frontCover"
];
$frontCover
=
$_POST
[
"frontCover"
];
$result
=
1
;
//主力房源的图片与房子信息关联插入数据库
//主力房源的图片与房子信息关联插入数据库
if
(
isset
(
$uploadedfile
[
"name"
])){
if
(
isset
(
$uploadedfile
[
"name"
])){
foreach
(
$uploadedfile
[
"name"
]
as
$key
=>
$value
)
{
foreach
(
$uploadedfile
[
"name"
]
as
$key
=>
$value
)
{
...
@@ -128,9 +123,9 @@ class InsertDao{
...
@@ -128,9 +123,9 @@ class InsertDao{
$imagePath
=
get_home_path
()
.
$url
;
$imagePath
=
get_home_path
()
.
$url
;
Image
::
makeImage
(
$uploadFileName
,
$imagePath
);
Image
::
makeImage
(
$uploadFileName
,
$imagePath
);
//插入图片表
//插入图片表
$
imgRes
=
$
wpdb
->
insert
(
'tospur_image'
,
$insert_image_array
);
$wpdb
->
insert
(
'tospur_image'
,
$insert_image_array
);
if
(
!
$imgRes
)
{
if
(
$wpdb
->
last_error
)
{
return
501
;
return
$wpdb
->
last_error
;
}
}
//获取插入图片的id
//获取插入图片的id
...
@@ -147,10 +142,8 @@ class InsertDao{
...
@@ -147,10 +142,8 @@ class InsertDao{
"house_area"
=>
$data
[
"
$key
"
][
"housearea"
],
"house_area"
=>
$data
[
"
$key
"
][
"housearea"
],
"image_id"
=>
$imgid
"image_id"
=>
$imgid
);
);
$houseTypeAreaRes
=
$wpdb
->
insert
(
Config
::
A_DISTRICT_AREA_TABLE
,
$houseTypeArea
);
$wpdb
->
insert
(
Config
::
A_DISTRICT_AREA_TABLE
,
$houseTypeArea
);
if
(
$houseTypeAreaRes
)
{
if
(
$wpdb
->
last_error
)
{
return
$houseTypeAreaRes
;
}
else
{
return
$wpdb
->
last_error
;
return
$wpdb
->
last_error
;
}
}
}
}
...
@@ -159,9 +152,9 @@ class InsertDao{
...
@@ -159,9 +152,9 @@ class InsertDao{
'house_id'
=>
$houseId
,
'house_id'
=>
$houseId
,
'image_id'
=>
$imgid
,
'image_id'
=>
$imgid
,
);
);
$
houseImgRes
=
$
wpdb
->
insert
(
Config
::
A_HOUSE_IMAGE_TABLE
,
$house_img_array
);
$wpdb
->
insert
(
Config
::
A_HOUSE_IMAGE_TABLE
,
$house_img_array
);
if
(
$
houseImgRes
)
{
if
(
$
wpdb
->
last_error
)
{
return
$
houseImgRes
;
return
$
wpdb
->
last_error
;
}
}
}
else
{
}
else
{
return
$movefile
[
'error'
];
return
$movefile
[
'error'
];
...
@@ -170,6 +163,10 @@ class InsertDao{
...
@@ -170,6 +163,10 @@ class InsertDao{
}
}
}
}
$wpdb
->
update
(
Config
::
TOSPUR_HOUSE_TABLE
,
array
(
"frontCover_id"
=>
$frontCover
),
array
(
"id"
=>
$houseId
));
$wpdb
->
update
(
Config
::
TOSPUR_HOUSE_TABLE
,
array
(
"frontCover_id"
=>
$frontCover
),
array
(
"id"
=>
$houseId
));
if
(
$wpdb
->
last_error
)
{
return
$wpdb
->
last_error
;
}
return
$result
;
}
}
public
static
function
addRecommend
(
$houseId
,
$data
){
public
static
function
addRecommend
(
$houseId
,
$data
){
...
@@ -181,14 +178,13 @@ class InsertDao{
...
@@ -181,14 +178,13 @@ class InsertDao{
"house_id"
=>
$houseId
,
"house_id"
=>
$houseId
,
"recommend_id"
=>
$value
"recommend_id"
=>
$value
);
);
$a_house_recommendRes
=
$wpdb
->
insert
(
Config
::
A_HOUSE_RECOMMEND_TABLE
,
$a_house_recommendArray
);
$wpdb
->
insert
(
Config
::
A_HOUSE_RECOMMEND_TABLE
,
$a_house_recommendArray
);
}
if
(
$wpdb
->
last_error
){
if
(
$a_house_recommendRes
){
return
$wpdb
->
last_error
;
return
$a_house_recommendRes
;
}
}
else
{
return
$wpdb
->
last_error
;
}
}
}
}
return
1
;
}
}
public
static
function
addRecConsultant
(
$houseId
,
$consultant
){
public
static
function
addRecConsultant
(
$houseId
,
$consultant
){
...
@@ -201,14 +197,13 @@ class InsertDao{
...
@@ -201,14 +197,13 @@ class InsertDao{
"house_id"
=>
$houseId
,
"house_id"
=>
$houseId
,
"user_type"
=>
1
"user_type"
=>
1
);
);
$a_house_userRes
=
$wpdb
->
replace
(
Config
::
A_HOUSE_USER_TABLE
,
$a_house_userArray
);
$wpdb
->
replace
(
Config
::
A_HOUSE_USER_TABLE
,
$a_house_userArray
);
}
if
(
$wpdb
->
last_error
){
if
(
$a_house_userRes
){
return
$wpdb
->
last_error
;
return
$a_house_userRes
;
}
}
else
{
return
$wpdb
->
last_error
;
}
}
}
}
return
1
;
}
}
public
static
function
addHouseFeature
(
$houseId
,
$houseFeature
){
public
static
function
addHouseFeature
(
$houseId
,
$houseFeature
){
...
@@ -219,15 +214,13 @@ class InsertDao{
...
@@ -219,15 +214,13 @@ class InsertDao{
"house_id"
=>
$houseId
,
"house_id"
=>
$houseId
,
"tag_id"
=>
$val
"tag_id"
=>
$val
);
);
$a_house_featureRes
=
$wpdb
->
insert
(
Config
::
A_HOUSE_TAG_TABLE
,
$a_house_feature
);
$wpdb
->
insert
(
Config
::
A_HOUSE_TAG_TABLE
,
$a_house_feature
);
if
(
$wpdb
->
last_error
){
}
return
$wpdb
->
last_error
;
if
(
$a_house_featureRes
){
}
return
$a_house_featureRes
;
}
else
{
return
$wpdb
->
last_error
;
}
}
}
}
return
1
;
}
}
...
@@ -240,6 +233,9 @@ class InsertDao{
...
@@ -240,6 +233,9 @@ class InsertDao{
" left JOIN "
.
Config
::
TOSPUR_TAG_TABLE
.
" tt on aht.tag_id = tt.id) as a"
.
" left JOIN "
.
Config
::
TOSPUR_TAG_TABLE
.
" tt on aht.tag_id = tt.id) as a"
.
" where house_id = %d and a.type = 0);"
,
$house_id
)
" where house_id = %d and a.type = 0);"
,
$house_id
)
);
);
if
(
$wpdb
->
last_error
){
return
$wpdb
->
last_error
;
}
if
(
$houseTag
)
{
if
(
$houseTag
)
{
foreach
(
$houseTag
as
$val
)
{
foreach
(
$houseTag
as
$val
)
{
$a_house_tag
=
array
(
$a_house_tag
=
array
(
...
@@ -247,8 +243,12 @@ class InsertDao{
...
@@ -247,8 +243,12 @@ class InsertDao{
"tag_id"
=>
$val
"tag_id"
=>
$val
);
);
$wpdb
->
insert
(
Config
::
A_HOUSE_TAG_TABLE
,
$a_house_tag
);
$wpdb
->
insert
(
Config
::
A_HOUSE_TAG_TABLE
,
$a_house_tag
);
if
(
$wpdb
->
last_error
){
return
$wpdb
->
last_error
;
}
}
}
}
}
return
1
;
}
}
public
static
function
arrayToString
(
$array
)
public
static
function
arrayToString
(
$array
)
...
...
wp-content/plugins/tospur/Dao/SearchDao.php
View file @
102311c9
...
@@ -305,7 +305,7 @@ class SearchDao
...
@@ -305,7 +305,7 @@ class SearchDao
}
}
if
(
$consultantName
!=
NULL
){
if
(
$consultantName
!=
NULL
){
$params
[]
=
'%'
.
$consultantName
.
'%'
;
$params
[]
=
'%'
.
$consultantName
.
'%'
;
$sql
=
$sql
.
" and name like %s"
;
$sql
=
$sql
.
" and
tc.
name like %s"
;
}
}
$result
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
$sql
,
$params
));
$result
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
$sql
,
$params
));
return
$result
;
return
$result
;
...
...
wp-content/plugins/tospur/Dao/TospurDao.php
View file @
102311c9
<?php
<?php
require_once
(
PLUGIN_DIR
.
'Config.php'
);
require_once
(
PLUGIN_DIR
.
'Config.php'
);
class
TospurDao
class
TospurDao
...
...
wp-content/plugins/tospur/Tools/Core.php
View file @
102311c9
...
@@ -3,4 +3,29 @@
...
@@ -3,4 +3,29 @@
require_once
(
PLUGIN_DIR
.
'Config.php'
);
require_once
(
PLUGIN_DIR
.
'Config.php'
);
class
Core
{
class
Core
{
function
get_week
(
$year
)
{
$year_start
=
$year
.
"-01-01"
;
$year_end
=
$year
.
"-12-31"
;
$startday
=
strtotime
(
$year_start
);
if
(
intval
(
date
(
'N'
,
$startday
))
!=
'1'
)
{
$startday
=
strtotime
(
"next monday"
,
strtotime
(
$year_start
));
//获取年第一周的日期
}
$year_mondy
=
date
(
"Y-m-d"
,
$startday
);
//获取年第一周的日期
$endday
=
strtotime
(
$year_end
);
if
(
intval
(
date
(
'W'
,
$endday
))
==
'7'
)
{
$endday
=
strtotime
(
"last sunday"
,
strtotime
(
$year_end
));
}
$num
=
intval
(
date
(
'W'
,
$endday
));
for
(
$i
=
1
;
$i
<=
$num
;
$i
++
)
{
$j
=
$i
-
1
;
$start_date
=
date
(
"Y-m-d"
,
strtotime
(
"
$year_mondy
$j
week "
));
$end_day
=
date
(
"Y-m-d"
,
strtotime
(
"
$start_date
+6 day"
));
$week_array
[
$i
]
=
array
(
$start_date
,
$end_day
);
}
return
$week_array
;
}
}
}
\ No newline at end of file
wp-content/plugins/tospur/Tools/TCSync.php
View file @
102311c9
...
@@ -22,7 +22,7 @@ class TCSync {
...
@@ -22,7 +22,7 @@ class TCSync {
$user
=
get_user_by
(
"login"
,
$item
[
'WorkNum'
]
);
$user
=
get_user_by
(
"login"
,
$item
[
'WorkNum'
]
);
$userdata
=
array
(
$userdata
=
array
(
'ID'
=>
$user
->
data
->
ID
,
'ID'
=>
$user
->
data
->
ID
,
'role'
=>
'
author
'
,
'role'
=>
'
zygw
'
,
'display_name'
=>
$item
[
'Name'
]
'display_name'
=>
$item
[
'Name'
]
);
);
$user_id
=
wp_update_user
(
$userdata
)
;
$user_id
=
wp_update_user
(
$userdata
)
;
...
@@ -30,7 +30,7 @@ class TCSync {
...
@@ -30,7 +30,7 @@ class TCSync {
$userdata
=
array
(
$userdata
=
array
(
'user_login'
=>
$item
[
'WorkNum'
],
'user_login'
=>
$item
[
'WorkNum'
],
'user_pass'
=>
$item
[
'WorkNumAndID'
],
// When creating an user, `user_pass` is expected.
'user_pass'
=>
$item
[
'WorkNumAndID'
],
// When creating an user, `user_pass` is expected.
'role'
=>
'
author
'
,
'role'
=>
'
zygw
'
,
'display_name'
=>
$item
[
'Name'
]
'display_name'
=>
$item
[
'Name'
]
);
);
$user_id
=
wp_insert_user
(
$userdata
)
;
$user_id
=
wp_insert_user
(
$userdata
)
;
...
@@ -70,6 +70,7 @@ class TCSync {
...
@@ -70,6 +70,7 @@ class TCSync {
$result
=
wp_remote_retrieve_body
(
$response
);
$result
=
wp_remote_retrieve_body
(
$response
);
$result
=
json_decode
(
$result
,
true
);
$result
=
json_decode
(
$result
,
true
);
//print_r($result['data']['CityList']);
//print_r($result['data']['CityList']);
$wpdb
->
query
(
"delete from "
.
Config
::
DIC_CITY_TABLE
.
" where cityId > -1;"
);
foreach
(
$result
[
'data'
][
'CityList'
]
as
$item
){
foreach
(
$result
[
'data'
][
'CityList'
]
as
$item
){
$wpdb
->
query
(
TCSync
::
create_insert_update_sql
(
Config
::
DIC_CITY_TABLE
,
$item
,
array
(
'plateId'
)));
$wpdb
->
query
(
TCSync
::
create_insert_update_sql
(
Config
::
DIC_CITY_TABLE
,
$item
,
array
(
'plateId'
)));
//print_r(TCSync::create_insert_update_sql(Config::CITY_TABLE,$item,array('plateId')));print_r("<br />");
//print_r(TCSync::create_insert_update_sql(Config::CITY_TABLE,$item,array('plateId')));print_r("<br />");
...
...
wp-content/plugins/tospur/index.php
View file @
102311c9
...
@@ -11,7 +11,7 @@ define('PLUGIN_DIR', dirname(__FILE__) . '/');
...
@@ -11,7 +11,7 @@ define('PLUGIN_DIR', dirname(__FILE__) . '/');
add_action
(
'init'
,
'tospur_init'
);
add_action
(
'init'
,
'tospur_init'
);
function
tospur_init
()
function
tospur_init
()
{
{
my_plugin_activate
();
require_once
(
PLUGIN_DIR
.
'Config.php'
);
require_once
(
PLUGIN_DIR
.
'Config.php'
);
require_once
(
PLUGIN_DIR
.
'Tools/TCSync.php'
);
require_once
(
PLUGIN_DIR
.
'Tools/TCSync.php'
);
require_once
(
PLUGIN_DIR
.
'Tools/Image.php'
);
require_once
(
PLUGIN_DIR
.
'Tools/Image.php'
);
...
@@ -184,26 +184,141 @@ function update_consultant()
...
@@ -184,26 +184,141 @@ function update_consultant()
}
}
}
}
function
my_plugin_activate
()
{
remove_role
(
"zygw"
);
remove_role
(
"qzzy"
);
remove_role
(
"xzzl"
);
remove_role
(
"jl"
);
$cRole
=
array
(
"xf"
=>
true
,
"xfList"
=>
true
,
"esf"
=>
true
,
"esfList"
=>
true
,
"zf"
=>
true
,
"zfList"
=>
true
,
"kh"
=>
true
,
"khList"
=>
true
,
"fygj"
=>
true
,
"sygl"
=>
true
,
"zygwpf"
=>
true
,
"zygwyj"
=>
true
,
"syjdb"
=>
true
,
"addTag"
=>
true
,
"addFeature"
=>
true
,
"dataSync"
=>
true
,
"houseApproval"
=>
true
,
"ht"
=>
true
,
"htEdit"
=>
true
,
"htApproval"
=>
true
,
"mySet"
=>
true
,
"fdfw_allot"
=>
true
,
"fdfw_cs"
=>
true
,
"fdfw_cz"
=>
true
,
"yyList"
=>
true
);
add_role
(
"zygw"
,
"置业顾问"
,
array
(
"xf"
=>
true
,
"xfList"
=>
true
,
"esf"
=>
true
,
"esfList"
=>
true
,
"zf"
=>
true
,
"zfList"
=>
true
,
"kh"
=>
true
,
"khList"
=>
true
,
"fygj"
=>
true
,
"ht"
=>
true
,
"fdfw_cs"
=>
true
,
"fdfw_cz"
=>
true
,
"mySet"
=>
true
,
"yyList"
=>
true
));
add_role
(
"qzzy"
,
"权证专员"
,
array
(
"ht"
=>
true
,
"htEdit"
=>
true
));
add_role
(
"xzzl"
,
"行政助理"
,
array
(
"xf"
=>
true
,
"xfList"
=>
true
,
"esf"
=>
true
,
"esfList"
=>
true
,
"zf"
=>
true
,
"zfList"
=>
true
,
"kh"
=>
true
,
"khList"
=>
true
,
"fygj"
=>
true
,
"sygl"
=>
true
,
"zygwpf"
=>
true
,
"zygwyj"
=>
true
,
"syjdb"
=>
true
,
"addTag"
=>
true
,
"addFeature"
=>
true
,
"dataSync"
=>
true
,
"houseApproval"
=>
true
,
"ht"
=>
true
,
"htEdit"
=>
true
,
"htApproval"
=>
true
,
"fdfw_allot"
=>
true
,
"fdfw_cs"
=>
true
,
"fdfw_cz"
=>
true
,
"yyList"
=>
true
));
add_role
(
"jl"
,
"经理"
,
array
(
"xf"
=>
true
,
"xfList"
=>
true
,
"esf"
=>
true
,
"esfList"
=>
true
,
"zf"
=>
true
,
"zfList"
=>
true
,
"kh"
=>
true
,
"khList"
=>
true
,
"fygj"
=>
true
,
"sygl"
=>
true
,
"zygwpf"
=>
true
,
"zygwyj"
=>
true
,
"syjdb"
=>
true
,
"addTag"
=>
true
,
"addFeature"
=>
true
,
"dataSync"
=>
true
,
"houseApproval"
=>
true
,
"ht"
=>
true
,
"htEdit"
=>
true
,
"htApproval"
=>
true
,
"fdfw_allot"
=>
true
,
"fdfw_cs"
=>
true
,
"fdfw_cz"
=>
true
,
"yyList"
=>
true
));
}
register_activation_hook
(
__FILE__
,
'my_plugin_activate'
);
function
reset_menu
()
function
reset_menu
()
{
{
add_menu_page
(
'新房列表'
,
'新房列表'
,
'edit_published_posts'
,
'newHouseList'
,
'function_newHouseList'
,
'dashicons-menu'
,
6
);
add_menu_page
(
'新房列表'
,
'新房列表'
,
'xfList'
,
'newHouseList'
,
'function_newHouseList'
,
'dashicons-menu'
,
6
);
add_submenu_page
(
'newHouseList'
,
'添加新房'
,
'添加新房'
,
'edit_published_posts'
,
'newHouse'
,
'House::init_view'
);
add_submenu_page
(
'newHouseList'
,
'添加新房'
,
'添加新房'
,
'xf'
,
'newHouse'
,
'House::init_view'
);
add_menu_page
(
'二手房列表'
,
'二手房列表'
,
'edit_published_posts'
,
'secHandHouseList'
,
'function_secHandHouseList'
,
'dashicons-menu'
,
7
);
add_menu_page
(
'二手房列表'
,
'二手房列表'
,
'esfList'
,
'secHandHouseList'
,
'function_secHandHouseList'
,
'dashicons-menu'
,
7
);
add_submenu_page
(
'secHandHouseList'
,
'添加二手房'
,
'添加二手房'
,
'edit_published_posts'
,
'secHandHouse'
,
'SecHandHouse::secHandHouse_html'
);
add_submenu_page
(
'secHandHouseList'
,
'添加二手房'
,
'添加二手房'
,
'esf'
,
'secHandHouse'
,
'SecHandHouse::secHandHouse_html'
);
add_menu_page
(
'租房列表'
,
'租房列表'
,
'edit_published_posts'
,
'rentHouseList'
,
'function_rentHouseList'
,
'dashicons-menu'
,
8
);
add_menu_page
(
'租房列表'
,
'租房列表'
,
'zfList'
,
'rentHouseList'
,
'function_rentHouseList'
,
'dashicons-menu'
,
8
);
add_submenu_page
(
'rentHouseList'
,
'添加租房'
,
'添加租房'
,
'edit_published_posts'
,
'rentHouse'
,
'RentHouse::rentHouse_html'
);
add_submenu_page
(
'rentHouseList'
,
'添加租房'
,
'添加租房'
,
'zf'
,
'rentHouse'
,
'RentHouse::rentHouse_html'
);
add_menu_page
(
"诚信宣言"
,
"诚信宣言"
,
"author"
,
"introduction"
,
"introduction::introduction_html"
,
'dashicons-menu'
,
9
);
add_menu_page
(
"我的设置"
,
"我的设置"
,
"mySet"
,
"introduction"
,
"introduction::introduction_html"
,
'dashicons-menu'
,
9
);
add_menu_page
(
'合同列表'
,
'合同列表'
,
'edit_published_posts'
,
'contractList'
,
'Contract_List::showTableView'
,
'dashicons-menu'
,
10
);
add_menu_page
(
'合同列表'
,
'合同列表'
,
'ht'
,
'contractList'
,
'Contract_List::showTableView'
,
'dashicons-menu'
,
10
);
add_submenu_page
(
'contractList'
,
'添加合同'
,
'添加合同'
,
'edit_published_posts'
,
'contract'
,
'Contract::init_view'
);
add_submenu_page
(
'contractList'
,
'添加合同'
,
'添加合同'
,
'htEdit'
,
'contract'
,
'Contract::init_view'
);
add_menu_page
(
'客户列表'
,
'客户列表'
,
'edit_published_posts'
,
'customerList'
,
'function_customerList'
,
'dashicons-menu'
,
11
);
add_menu_page
(
'客户列表'
,
'客户列表'
,
'khList'
,
'customerList'
,
'function_customerList'
,
'dashicons-menu'
,
11
);
add_submenu_page
(
'customerList'
,
'新增客户'
,
'新增客户'
,
'edit_published_posts'
,
'customer'
,
'customer::customer_html'
);
add_submenu_page
(
'customerList'
,
'新增客户'
,
'新增客户'
,
'kh'
,
'customer'
,
'customer::customer_html'
);
add_menu_page
(
'签约—房客跟进'
,
'签约—房客跟进'
,
'edit_published_posts'
,
'customerTrackingList'
,
'function_customerTrackingList'
,
'dashicons-menu'
,
12
);
add_menu_page
(
'房客跟进'
,
'房客跟进'
,
'fygj'
,
'customerTrackingList'
,
'function_customerTrackingList'
,
'dashicons-menu'
,
12
);
add_menu_page
(
'收佣管理'
,
'收佣管理'
,
'edit_published_posts'
,
'commissionManage'
,
'commissionManage::commissionManage_html'
,
'dashicons-menu'
,
13
);
add_menu_page
(
'置业顾问评分'
,
'置业顾问评分'
,
'zygwpf'
,
'consultant_score'
,
'consultant_score_page'
,
'dashicons-menu'
,
14
);
add_menu_page
(
'置业顾问评分'
,
'置业顾问评分'
,
'moderate_comments'
,
'consultant_score'
,
'consultant_score_page'
,
'dashicons-menu'
,
14
);
add_submenu_page
(
'consultant_score'
,
'置业顾问业绩'
,
'置业顾问业绩'
,
'zygwyj'
,
'quotaList'
,
'QuotaYearList::showHtml'
);
add_submenu_page
(
'consultant_score'
,
'置业顾问业绩'
,
'置业顾问业绩'
,
'edit_published_posts'
,
'quotaList'
,
'QuotaYearList::showHtml'
);
add_menu_page
(
'收佣进度表'
,
'收佣进度表'
,
'syjdb'
,
'commissionList'
,
'function_commissionList'
,
'dashicons-menu'
,
15
);
add_menu_page
(
'收佣进度表'
,
'收佣进度表'
,
'moderate_comments'
,
'commissionList'
,
'function_commissionList'
,
'dashicons-menu'
,
15
);
add_menu_page
(
'添加标签'
,
'添加标签'
,
'edit_published_posts'
,
'add_tag'
,
'feature::add_feature_html'
,
'dashicons-menu'
);
add_menu_page
(
'房东服务'
,
'房东服务'
,
'fdfw_cs'
,
'tospur_sale_secondhand'
,
'tospur_sale_page'
,
'dashicons-menu'
,
16
);
add_menu_page
(
'添加特色'
,
'添加特色'
,
'edit_published_posts'
,
'add_feature'
,
'feature::add_feature_html'
,
'dashicons-menu'
);
add_submenu_page
(
'tospur_sale_secondhand'
,
'出售'
,
'出售'
,
'fdfw_cs'
,
'tospur_sale_secondhand'
,
'tospur_sale_page'
);
add_menu_page
(
"同步数据"
,
"同步数据"
,
"manage_options"
,
"sync"
,
"TCSyncView::display"
,
'dashicons-menu'
);
add_submenu_page
(
'tospur_sale_secondhand'
,
'出租'
,
'出租'
,
'fdfw_cz'
,
'tospur_sale_rent'
,
'tospur_sale_page'
);
add_menu_page
(
'预约列表'
,
'预约列表'
,
'yyList'
,
'view_house'
,
'view_house_page'
,
'dashicons-menu'
,
17
);
add_menu_page
(
'添加标签'
,
'添加标签'
,
'addTag'
,
'add_tag'
,
'feature::add_feature_html'
,
'dashicons-menu'
);
add_menu_page
(
'添加特色'
,
'添加特色'
,
'addFeature'
,
'add_feature'
,
'feature::add_feature_html'
,
'dashicons-menu'
);
add_menu_page
(
"同步数据"
,
"同步数据"
,
"dataSync"
,
"sync"
,
"TCSyncView::display"
,
'dashicons-menu'
);
//移除更新信息
//移除更新信息
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 @
102311c9
...
@@ -242,11 +242,14 @@ function new_login_redirect($redirect_to, $request, $user)
...
@@ -242,11 +242,14 @@ function new_login_redirect($redirect_to, $request, $user)
{
{
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'
||
$role
==
'zygw'
||
$role
==
'xzzl'
||
$role
==
'jl'
)
{
return
admin_url
(
'admin.php?page=newHouseList'
);
$url
=
admin_url
(
'admin.php?page=newHouseList'
);
}
else
if
(
$role
==
'qzzy'
){
$url
=
admin_url
(
'admin.php?page=contractList'
);
}
else
{
}
else
{
return
site_url
();
$url
=
site_url
();
}
}
return
$url
;
}
else
{
}
else
{
return
$redirect_to
;
return
$redirect_to
;
}
}
...
@@ -270,8 +273,10 @@ function user_redirect($user)
...
@@ -270,8 +273,10 @@ 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'
||
$role
==
'author'
)
{
if
(
$role
==
'administrator'
||
$role
==
'editor'
||
$role
==
'author'
||
$role
==
'zygw'
||
$role
==
'xzzl'
||
$role
==
'jl'
)
{
$url
=
admin_url
(
'admin.php?page=newHouseList'
);
$url
=
admin_url
(
'admin.php?page=newHouseList'
);
}
else
if
(
$role
==
'qzzy'
){
$url
=
admin_url
(
'admin.php?page=contractList'
);
}
else
{
}
else
{
$url
=
site_url
();
$url
=
site_url
();
}
}
...
...
wp-content/themes/tospur/js/public.js
View file @
102311c9
...
@@ -136,7 +136,7 @@ function ajax_get_house(url, loading, ajax_data, context) {
...
@@ -136,7 +136,7 @@ function ajax_get_house(url, loading, ajax_data, context) {
div
.
find
(
'[data-attr=community]'
).
text
(
value
.
community_name
);
div
.
find
(
'[data-attr=community]'
).
text
(
value
.
community_name
);
div
.
find
(
'[data-attr=apartment]'
).
text
(
value
.
bp_literal
);
div
.
find
(
'[data-attr=apartment]'
).
text
(
value
.
bp_literal
);
div
.
find
(
'[data-attr=covered_area]'
).
text
(
value
.
covered_area
+
'平米'
);
div
.
find
(
'[data-attr=covered_area]'
).
text
(
value
.
covered_area
+
'平米'
);
div
.
find
(
'[data-attr=price]'
).
html
(
'<em>'
+
(
value
.
total_price
/
10000
)
+
'万</em>'
);
div
.
find
(
'[data-attr=price]'
).
html
(
'<em>'
+
(
value
.
total_price
/
10000
)
.
toFixed
(
0
)
+
'万</em>'
);
}
else
if
(
houseType
==
2
)
{
}
else
if
(
houseType
==
2
)
{
div
.
find
(
'[data-attr=community]'
).
text
(
value
.
community_name
);
div
.
find
(
'[data-attr=community]'
).
text
(
value
.
community_name
);
div
.
find
(
'[data-attr=apartment]'
).
text
(
value
.
bp_literal
);
div
.
find
(
'[data-attr=apartment]'
).
text
(
value
.
bp_literal
);
...
...
wp-content/themes/tospur/list.php
View file @
102311c9
...
@@ -13,7 +13,7 @@ if ($current_user_id != 0) {
...
@@ -13,7 +13,7 @@ if ($current_user_id != 0) {
case
'subscriber'
:
case
'subscriber'
:
$result
=
TospurDao
::
search_view_house_by_user_id
(
$current_user_id
);
$result
=
TospurDao
::
search_view_house_by_user_id
(
$current_user_id
);
break
;
break
;
case
'
editor
'
:
case
'
zygw
'
:
$result
=
TospurDao
::
search_view_house_by_consultant_id
(
$current_user_id
);
$result
=
TospurDao
::
search_view_house_by_consultant_id
(
$current_user_id
);
break
;
break
;
}
}
...
...
wp-content/themes/tospur/my.php
View file @
102311c9
...
@@ -12,13 +12,11 @@ if ($current_user_id == 0) {
...
@@ -12,13 +12,11 @@ if ($current_user_id == 0) {
$role
=
$current_user
->
roles
[
0
];
$role
=
$current_user
->
roles
[
0
];
$user_role
=
''
;
$user_role
=
''
;
switch
(
$role
)
{
switch
(
$role
)
{
case
'administrator'
:
case
'subscriber'
:
case
'subscriber'
:
$user_role
=
'用户'
;
$user_role
=
'用户'
;
wp_redirect
(
get_site_url
()
.
"?page=myHouse"
);
wp_redirect
(
get_site_url
()
.
"?page=myHouse"
);
break
;
break
;
case
'
editor
'
:
case
'
zygw
'
:
$user_role
=
'置业顾问'
;
$user_role
=
'置业顾问'
;
wp_redirect
(
get_site_url
()
.
"?page=list"
);
wp_redirect
(
get_site_url
()
.
"?page=list"
);
break
;
break
;
...
...
wp-content/themes/tospur/views/index.html
View file @
102311c9
...
@@ -274,7 +274,9 @@
...
@@ -274,7 +274,9 @@
$
(
"#urbanArea_scroller"
).
children
(
":not(:first)"
).
remove
();
$
(
"#urbanArea_scroller"
).
children
(
":not(:first)"
).
remove
();
if
(
$
(
this
).
attr
(
"data-id"
)
!=
undefined
){
if
(
$
(
this
).
attr
(
"data-id"
)
!=
undefined
){
$
.
each
(
plate
[
$
(
this
).
attr
(
"data-id"
)],
function
(
i
,
item
){
$
.
each
(
plate
[
$
(
this
).
attr
(
"data-id"
)],
function
(
i
,
item
){
$
(
"#urbanArea_scroller"
).
append
(
'<a data-id="'
+
item
.
id
+
'">'
+
item
.
value
+
'</a>'
);
if
(
item
.
value
){
$
(
"#urbanArea_scroller"
).
append
(
'<a data-id="'
+
item
.
id
+
'">'
+
item
.
value
+
'</a>'
);
}
});
});
}
}
urbanAreaScroll
.
refresh
();
urbanAreaScroll
.
refresh
();
...
...
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