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
bafaed0d
Commit
bafaed0d
authored
Sep 22, 2015
by
shz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每日一更
parent
6527ff71
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
397 additions
and
228 deletions
+397
-228
wp-content/plugins/tospur/Admin/House.php
+2
-2
wp-content/plugins/tospur/Admin/customerList.php
+13
-33
wp-content/plugins/tospur/Admin/customerTrackingList.php
+10
-8
wp-content/plugins/tospur/Admin/rentHouse.php
+2
-2
wp-content/plugins/tospur/Admin/rentHouseList.php
+84
-80
wp-content/plugins/tospur/Admin/secHandHouse.php
+2
-2
wp-content/plugins/tospur/Admin/secHandHouseList.php
+87
-82
wp-content/plugins/tospur/Admin/views/customerList.html
+0
-0
wp-content/plugins/tospur/Admin/views/customerTrackingList.html
+23
-6
wp-content/plugins/tospur/Admin/views/js/public.js
+46
-2
wp-content/plugins/tospur/Admin/views/listBlock.html
+14
-3
wp-content/plugins/tospur/Admin/views/selectOrganization.html
+71
-0
wp-content/plugins/tospur/Dao/HouseDao.php
+15
-0
wp-content/plugins/tospur/Dao/InsertDao.php
+9
-6
wp-content/plugins/tospur/Dao/SearchDao.php
+15
-1
wp-content/plugins/tospur/Tools/TCSync.php
+4
-1
No files found.
wp-content/plugins/tospur/Admin/House.php
View file @
bafaed0d
...
...
@@ -129,7 +129,7 @@ class House extends Tospur_House{
}
$wpdb
->
delete
(
Config
::
A_HOUSE_USER_TABLE
,
array
(
"house_id"
=>
$houseId
));
$res
=
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
$res
=
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
if
(
$res
==
505
){
$result
=
$res
;
echo
"推荐置业顾问修改失败"
;
...
...
@@ -154,7 +154,7 @@ class House extends Tospur_House{
InsertDao
::
addRecommend
(
$houseId
,
$data
);
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
...
...
wp-content/plugins/tospur/Admin/customerList.php
View file @
bafaed0d
...
...
@@ -89,13 +89,18 @@ class customerList extends WP_List_Table
$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 tospur_consultant tc on tcs.consultant_id = tc.id where 1 = 1"
;
" left join tospur_consultant tc on tcs.consultant_id = tc.id"
.
" left join tospur_organization torg on tc.subsidiaryId = torg.id"
.
" where 1 = 1"
;
$current_user
=
wp_get_current_user
();
if
(
$current_user
->
roles
[
0
]
==
'author'
){
$sql
=
$sql
.
" and tcs.consultant_id = "
.
$current_user
->
ID
;
}
if
(
isset
(
$_REQUEST
[
'organization'
])
&&
$_REQUEST
[
'organization'
]
!=
-
1
)
{
$sql
=
$sql
.
" and tc.subsidiaryId = "
.
$_REQUEST
[
'organization'
];
}
if
(
isset
(
$_REQUEST
[
'status'
])
&&
$_REQUEST
[
'status'
]
!=
-
1
)
{
$sql
=
$sql
.
" and tcs.status = "
.
$_REQUEST
[
'status'
];
}
...
...
@@ -128,11 +133,11 @@ class customerList extends WP_List_Table
if
(
isset
(
$_REQUEST
[
'listPlate'
])
&&
$_REQUEST
[
"listPlate"
]
!=
-
1
)
{
$sql
=
$sql
.
" and tcs.plate_id = "
.
$_REQUEST
[
"listPlate"
];
}
if
(
$_REQUEST
[
"totalPrice"
]
!=
null
)
{
if
(
isset
(
$_REQUEST
[
'totalPrice'
])
&&
$_REQUEST
[
"totalPrice"
]
!=
-
1
)
{
$priceArray
=
explode
(
"-"
,
$_REQUEST
[
'totalPrice'
]);
$sql
=
$sql
.
" and (tcs.min_totalPrice >= "
.
$priceArray
[
0
]
.
" and tcs.max_totalPrice <= "
.
$priceArray
[
1
]
.
")"
;
}
if
(
$_REQUEST
[
"rentalPrice"
]
!=
null
)
{
if
(
isset
(
$_REQUEST
[
'rentalPrice'
])
&&
$_REQUEST
[
"rentalPrice"
]
!=
-
1
)
{
$priceArray
=
explode
(
"-"
,
$_REQUEST
[
'rentalPrice'
]);
$sql
=
$sql
.
" and (tcs.min_rent >= "
.
$priceArray
[
0
]
.
" and tcs.max_rent <= "
.
$priceArray
[
1
]
.
")"
;
}
...
...
@@ -143,7 +148,7 @@ class customerList extends WP_List_Table
$sql
=
$sql
.
" and (tcs.bedroom = "
.
$_REQUEST
[
"buildProperty"
]
.
" or tcs.bedroom = -1)"
;
}
}
if
(
$_REQUEST
[
"acreage"
]
!=
null
)
{
if
(
isset
(
$_REQUEST
[
'acreage'
])
&&
$_REQUEST
[
"acreage"
]
!=
-
1
)
{
$areaArray
=
explode
(
"-"
,
$_REQUEST
[
'acreage'
]);
$sql
=
$sql
.
" and (tcs.min_coveredArea >= "
.
$areaArray
[
0
]
.
" and tcs.max_coveredArea <= "
.
$areaArray
[
1
]
.
")"
;
}
...
...
@@ -208,43 +213,18 @@ class customerList extends WP_List_Table
function
function_customerList
()
{
$context
=
array
();
//
$context
[
'city'
]
=
SearchDao
::
searchCity
();
$context
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
//
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
5
);
$context
[
'customer_type'
]
=
SearchDao
::
searchStatusType
(
6
);
$context
[
'city'
]
=
SearchDao
::
searchCity
();
if
(
isset
(
$_REQUEST
[
'hasSearch'
]))
{
$context
[
'district'
]
=
SearchDao
::
searchCity
(
$_REQUEST
[
'listCity'
]);
$context
[
'plate'
]
=
SearchDao
::
searchCity
(
$_REQUEST
[
'listCity'
],
$_REQUEST
[
'listDistrict'
]);
$context
[
'dicTotalPrice'
]
=
searchDao
::
searchTotalPrice
(
$_REQUEST
[
'listCity'
]);
$context
[
'dicRentalPrice'
]
=
searchDao
::
searchRentalPrice
(
$_REQUEST
[
'listCity'
]);
$context
[
'dicArea'
]
=
searchDao
::
searchArea
(
$_REQUEST
[
'listCity'
]);
$context
[
'cityId'
]
=
$_REQUEST
[
'listCity'
];
$context
[
'districtId'
]
=
$_REQUEST
[
'listDistrict'
];
$context
[
'plateId'
]
=
$_REQUEST
[
'listPlate'
];
$context
[
'buildPropertyId'
]
=
$_REQUEST
[
'buildProperty'
];
$context
[
'totalPrice'
]
=
$_REQUEST
[
'totalPrice'
];
$context
[
'rentalPrice'
]
=
$_REQUEST
[
'rentalPrice'
];
$context
[
'acreage'
]
=
$_REQUEST
[
'acreage'
];
$context
[
'req'
]
=
$_REQUEST
;
}
$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'
]
);
$_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 @
bafaed0d
...
...
@@ -37,13 +37,18 @@ class customerTrackingList extends WP_List_Table
$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 tospur_consultant tc on tct.consultant_id = tc.id where 1 = 1"
;
" left join tospur_consultant tc on tct.consultant_id = tc.id"
.
" left join tospur_organization torg on tc.subsidiaryId = torg.id"
.
" where 1 = 1"
;
if
(
isset
(
$_REQUEST
[
'organization'
])
&&
$_REQUEST
[
'organization'
]
!=
-
1
)
{
$sql
=
$sql
.
" and tc.subsidiaryId = "
.
$_REQUEST
[
'organization'
];
}
if
(
isset
(
$_REQUEST
[
'status_type'
])
&&
$_REQUEST
[
'status_type'
]
!=
-
1
)
{
$sql
=
$sql
.
" and tct.status_type = "
.
$_REQUEST
[
'status_type'
];
}
if
(
isset
(
$_REQUEST
[
'search_consultant_name'
]))
{
if
(
isset
(
$_REQUEST
[
'search_consultant_name'
])
&&
$_REQUEST
[
'search_consultant_name'
]
!=
null
)
{
$sql
=
$sql
.
" and tc.name like '%"
.
$_REQUEST
[
'search_consultant_name'
]
.
"%'"
;
}
if
(
isset
(
$_REQUEST
[
'search_min_time'
])
&&
$_REQUEST
[
'search_min_time'
]
!=
null
)
{
...
...
@@ -92,17 +97,14 @@ function function_customerTrackingList()
{
$context
=
array
();
$context
[
'status'
]
=
SearchDao
::
searchStatusType
(
3
);
$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'
];
$context
[
'req'
]
=
$_REQUEST
;
Timber
::
render
(
"customerTrackingList.html"
,
$context
);
}
function
addCustomerTrackingTable
()
{
$_SERVER
[
'REQUEST_URI'
]
=
remove_query_arg
(
'_wp_http_referer'
,
$_SERVER
[
'REQUEST_URI'
]
);
$_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/rentHouse.php
View file @
bafaed0d
...
...
@@ -113,7 +113,7 @@ class RentHouse extends Tospur_House{
InsertDao
::
addRecommend
(
$houseId
,
$data
);
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
}
else
{
...
...
@@ -151,7 +151,7 @@ class RentHouse extends Tospur_House{
InsertDao
::
addRecommend
(
$houseId
,
$data
);
$wpdb
->
delete
(
Config
::
A_HOUSE_USER_TABLE
,
array
(
"house_id"
=>
$houseId
));
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
InsertDao
::
addHouseTag
(
$_POST
[
'mark'
],
$houseId
);
return
$result
;
...
...
wp-content/plugins/tospur/Admin/rentHouseList.php
View file @
bafaed0d
...
...
@@ -41,11 +41,10 @@ class rentHouseList extends WP_List_Table
function
column_cb
(
$item
)
{
return
sprintf
(
'<input type="checkbox" name="%1$s[]" value="%2$s" />'
,
/*$1%s*/
$this
->
_args
[
'singular'
],
//Let's simply repurpose the table's singular label ("score")
/*$2%s*/
$item
[
'id'
]
//The value of the checkbox should be the record's id
'<input type="checkbox" name="%1$s[]" value="%2$s" data-consultant="%3$s"/>'
,
$this
->
_args
[
'singular'
],
$item
[
'id'
],
$item
[
'consultant_id'
]
);
}
...
...
@@ -111,53 +110,57 @@ class rentHouseList extends WP_List_Table
if
(
$action
)
{
$string
=
null
;
$status
=
null
;
switch
(
$action
)
{
case
'noCheck'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
0
;
}
break
;
case
'check'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
1
;
}
break
;
case
'selfSale'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
2
;
}
break
;
case
'otherSale'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
3
;
}
break
;
case
'invalid'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
4
;
}
break
;
case
'reactivation'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
5
;
}
break
;
if
(
$action
==
'allot'
){
HouseDao
::
houseAllotConsultant
(
$_POST
[
'allot_consultant_id'
],
$_POST
[
'sechandhouselist'
]);
}
else
{
switch
(
$action
)
{
case
'noCheck'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
0
;
}
break
;
case
'check'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
1
;
}
break
;
case
'selfSale'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
2
;
}
break
;
case
'otherSale'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
3
;
}
break
;
case
'invalid'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
4
;
}
break
;
case
'reactivation'
:
$id
=
$_POST
[
'renthouselist'
];
if
(
$id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$id
))
.
')'
;
$status
=
5
;
}
break
;
}
global
$wpdb
;
$result
=
$wpdb
->
query
(
'update tospur_house SET status='
.
$status
.
' where id in '
.
$string
);
}
global
$wpdb
;
$result
=
$wpdb
->
query
(
'update tospur_house SET status='
.
$status
.
' where id in '
.
$string
);
}
}
...
...
@@ -183,44 +186,44 @@ class rentHouseList extends WP_List_Table
left join(select id as consul_id,name as consul_name from tospur_consultant) tc on ahu.aus_id = tc.consul_id
left join(select value,literal from dic_buildproperty) db on th.buildproperty_id = db.value
where 1=1 and house_type=2 "
;
if
(
$_
PO
ST
[
"listCity"
]
!=
0
){
$params
[]
=
$_
PO
ST
[
"listCity"
];
if
(
$_
REQUE
ST
[
"listCity"
]
!=
0
){
$params
[]
=
$_
REQUE
ST
[
"listCity"
];
$sql
=
$sql
.
" and city_id=%d"
;
}
if
(
$_
PO
ST
[
"listDistrict"
]
!=
0
){
$params
[]
=
$_
PO
ST
[
"listDistrict"
];
if
(
$_
REQUE
ST
[
"listDistrict"
]
!=
0
){
$params
[]
=
$_
REQUE
ST
[
"listDistrict"
];
$sql
=
$sql
.
" and district_id=%d"
;
}
if
(
$_
PO
ST
[
"listPlate"
]
!=
0
){
$params
[]
=
$_
PO
ST
[
"listPlate"
];
if
(
$_
REQUE
ST
[
"listPlate"
]
!=
0
){
$params
[]
=
$_
REQUE
ST
[
"listPlate"
];
$sql
=
$sql
.
" and plate_id=%d"
;
}
if
(
$_
PO
ST
[
"buildProperty"
]
!=
0
){
$params
[]
=
$_
PO
ST
[
"buildProperty"
];
if
(
$_
REQUE
ST
[
"buildProperty"
]
!=
0
){
$params
[]
=
$_
REQUE
ST
[
"buildProperty"
];
$sql
=
$sql
.
" and buildproperty_id=%d"
;
}
if
(
$_
PO
ST
[
"room"
]
!=
0
){
$params
[]
=
$_
PO
ST
[
"room"
];
if
(
$_
REQUE
ST
[
"room"
]
!=
0
){
$params
[]
=
$_
REQUE
ST
[
"room"
];
$sql
=
$sql
.
" and room_id=%d"
;
}
if
(
isset
(
$_
POST
[
"status"
])
&&
$_PO
ST
[
"status"
]
!=-
1
){
$params
[]
=
$_
PO
ST
[
"status"
];
if
(
isset
(
$_
REQUEST
[
"status"
])
&&
$_REQUE
ST
[
"status"
]
!=-
1
){
$params
[]
=
$_
REQUE
ST
[
"status"
];
$sql
=
$sql
.
" and status=%d"
;
}
if
(
$_
PO
ST
[
"rentalPrice"
]
!=
NULL
){
$priceArray
=
explode
(
"-"
,
$_
PO
ST
[
'rentalPrice'
]);
if
(
$_
REQUE
ST
[
"rentalPrice"
]
!=
NULL
){
$priceArray
=
explode
(
"-"
,
$_
REQUE
ST
[
'rentalPrice'
]);
$params
[]
=
$priceArray
[
0
];
$params
[]
=
$priceArray
[
1
];
$sql
=
$sql
.
" and rent between %d and %d"
;
}
if
(
$_
PO
ST
[
"acreage"
]
!=
NULL
){
$areaArray
=
explode
(
"-"
,
$_
PO
ST
[
'acreage'
]);
if
(
$_
REQUE
ST
[
"acreage"
]
!=
NULL
){
$areaArray
=
explode
(
"-"
,
$_
REQUE
ST
[
'acreage'
]);
$params
[]
=
$areaArray
[
0
];
$params
[]
=
$areaArray
[
1
];
$sql
=
$sql
.
" and covered_area between %d and %d"
;
}
if
(
$_
PO
ST
[
"searchText"
]
!=
NULL
){
$params
[]
=
'%'
.
$_
PO
ST
[
'searchText'
]
.
'%'
;
if
(
$_
REQUE
ST
[
"searchText"
]
!=
NULL
){
$params
[]
=
'%'
.
$_
REQUE
ST
[
'searchText'
]
.
'%'
;
$sql
=
$sql
.
" and name like %s"
;
}
if
(
isset
(
$_GET
[
"orderby"
])){
...
...
@@ -244,6 +247,7 @@ class rentHouseList extends WP_List_Table
'age'
=>
$value
->
age
,
'matching_facilities'
=>
$value
->
matching_facilities
,
'user_id'
=>
$value
->
consul_name
,
'consultant_id'
=>
$value
->
consul_id
);
if
(
$value
->
status
==
0
){
...
...
@@ -289,18 +293,18 @@ function function_rentHouseList()
$contest
[
'city'
]
=
SearchDao
::
searchCity
();
$contest
[
'status'
]
=
SearchDao
::
searchStatusType
(
2
);
$contest
[
'buildProperty'
]
=
SearchDao
::
searchBuildProperty
();
if
(
isset
(
$_
PO
ST
[
'hasSearch'
])){
$contest
[
'district'
]
=
SearchDao
::
searchCity
(
$_
PO
ST
[
'listCity'
]);
$contest
[
'plate'
]
=
SearchDao
::
searchCity
(
$_
POST
[
'listCity'
],
$_PO
ST
[
'listDistrict'
]);
$contest
[
'dicRentalPrice'
]
=
searchDao
::
searchRentalPrice
(
$_
PO
ST
[
'listCity'
]);
$contest
[
'dicArea'
]
=
searchDao
::
searchArea
(
$_
PO
ST
[
'listCity'
]);
$contest
[
'cityId'
]
=
$_
PO
ST
[
'listCity'
];
$contest
[
'districtId'
]
=
$_
PO
ST
[
'listDistrict'
];
$contest
[
'plateId'
]
=
$_
PO
ST
[
'listPlate'
];
$contest
[
'buildPropertyId'
]
=
$_
PO
ST
[
'buildProperty'
];
$contest
[
'rentalPrice'
]
=
$_
PO
ST
[
'rentalPrice'
];
$contest
[
'acreage'
]
=
$_
PO
ST
[
'acreage'
];
$contest
[
'statusId'
]
=
$_
PO
ST
[
'status'
];
if
(
isset
(
$_
REQUE
ST
[
'hasSearch'
])){
$contest
[
'district'
]
=
SearchDao
::
searchCity
(
$_
REQUE
ST
[
'listCity'
]);
$contest
[
'plate'
]
=
SearchDao
::
searchCity
(
$_
REQUEST
[
'listCity'
],
$_REQUE
ST
[
'listDistrict'
]);
$contest
[
'dicRentalPrice'
]
=
searchDao
::
searchRentalPrice
(
$_
REQUE
ST
[
'listCity'
]);
$contest
[
'dicArea'
]
=
searchDao
::
searchArea
(
$_
REQUE
ST
[
'listCity'
]);
$contest
[
'cityId'
]
=
$_
REQUE
ST
[
'listCity'
];
$contest
[
'districtId'
]
=
$_
REQUE
ST
[
'listDistrict'
];
$contest
[
'plateId'
]
=
$_
REQUE
ST
[
'listPlate'
];
$contest
[
'buildPropertyId'
]
=
$_
REQUE
ST
[
'buildProperty'
];
$contest
[
'rentalPrice'
]
=
$_
REQUE
ST
[
'rentalPrice'
];
$contest
[
'acreage'
]
=
$_
REQUE
ST
[
'acreage'
];
$contest
[
'statusId'
]
=
$_
REQUE
ST
[
'status'
];
}
$contest
[
"house_type"
]
=
2
;
Timber
::
render
(
"houseList.html"
,
$contest
);
...
...
wp-content/plugins/tospur/Admin/secHandHouse.php
View file @
bafaed0d
...
...
@@ -118,7 +118,7 @@ class SecHandHouse extends Tospur_House{
$recommendRes
=
InsertDao
::
addRecommend
(
$houseId
,
$data
);
$recConsultant
=
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
$recConsultant
=
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
InsertDao
::
addHouseTag
(
$houseId
,
$data
[
'houseTag'
]);
...
...
@@ -159,7 +159,7 @@ class SecHandHouse extends Tospur_House{
InsertDao
::
addRecommend
(
$houseId
,
$data
);
$wpdb
->
delete
(
Config
::
A_HOUSE_USER_TABLE
,
array
(
"house_id"
=>
$houseId
));
InsertDao
::
addRecConsultant
(
$houseId
,
$data
);
InsertDao
::
addRecConsultant
(
$houseId
,
$data
[
'recConsultant'
]
);
$wpdb
->
query
(
$wpdb
->
prepare
(
...
...
wp-content/plugins/tospur/Admin/secHandHouseList.php
View file @
bafaed0d
This diff is collapsed.
Click to expand it.
wp-content/plugins/tospur/Admin/views/customerList.html
View file @
bafaed0d
This diff is collapsed.
Click to expand it.
wp-content/plugins/tospur/Admin/views/customerTrackingList.html
View file @
bafaed0d
<div
class=
"wrap"
>
<h2>
签约-房客跟进
</h2>
<form
method=
"get"
>
<form
method=
"get"
id=
"search_form"
>
<input
type=
"hidden"
name=
"page"
value=
"customerTrackingList"
>
<div
id=
"search_form"
>
<div>
{% include 'selectOrganization.html' %}
<label
for=
"status_type"
class=
"hidden"
></label>
<select
name=
"status_type"
id=
"status_type"
>
<option
value=
"-1"
>
跟进类型
</option>
{% for item in status %}
<option
{{
item
.
id =
=
status_type
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{{
item
.
id =
=
(
req
.
status_type
)
?"
selected
"
:
""
}}
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
<label
for=
"search_consultant_name"
class=
"hidden"
></label>
<input
type=
"text"
placeholder=
"请输入置业顾问"
name=
"search_consultant_name"
id=
"search_consultant_name"
value=
"{{ search_consultant_name }}"
>
value=
"{{
req.
search_consultant_name }}"
>
<span>
日期
</span>
<label
for=
"search_min_time"
class=
"hidden"
></label>
<input
type=
"date"
name=
"search_min_time"
id=
"search_min_time"
value=
"{{ search_min_time }}"
>
<input
type=
"date"
name=
"search_min_time"
id=
"search_min_time"
value=
"{{
req.
search_min_time }}"
>
—
<label
for=
"search_max_time"
class=
"hidden"
></label>
<input
type=
"date"
name=
"search_max_time"
id=
"search_max_time"
value=
"{{ search_max_time }}"
>
<input
type=
"date"
name=
"search_max_time"
id=
"search_max_time"
value=
"{{
req.
search_max_time }}"
>
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"搜索"
>
</div>
</form>
<form
method=
"post"
>
{{ function("addCustomerTrackingTable") }}
</form>
</div>
<script>
$
(
document
).
ready
(
function
()
{
search_form_set_page
();
$
(
'form'
).
submit
(
function
()
{
var
organization
=
getOrganization
();
var
select
=
$
(
'select[data-depth]:not(.hidden)'
);
if
(
select
.
length
>
1
&&
organization
==
-
1
)
{
alert
(
'请选择门店'
);
return
false
;
}
else
{
$
(
this
).
append
(
'<input type="hidden" name="organization" value="'
+
organization
+
'">'
);
}
});
});
</script>
\ No newline at end of file
wp-content/plugins/tospur/Admin/views/js/public.js
View file @
bafaed0d
...
...
@@ -200,9 +200,10 @@
function
search_form_set_page
(){
var
search_flag
=
false
;
var
search_form
=
$
(
'#search_form'
);
$
(
'form'
).
submit
(
function
()
{
var
search_select
=
$
(
this
).
find
(
'#search_form
select'
);
var
search_input
=
$
(
this
).
find
(
'#search_form
input[type=text],input[type=date]'
);
var
search_select
=
search_form
.
find
(
'
select'
);
var
search_input
=
search_form
.
find
(
'
input[type=text],input[type=date]'
);
$
.
each
(
search_select
,
function
(
index
,
item
)
{
var
search_select_value
=
$
(
item
).
find
(
'option:selected'
).
val
();
if
(
search_select_value
!=
-
1
)
{
...
...
@@ -221,6 +222,49 @@
});
}
function
allot_consultant
(
name
)
{
//批量操作
$
(
'select[name=action],select[name=action2]'
).
change
(
function
()
{
//分配置业顾问
if
(
$
(
this
).
find
(
'option:selected'
).
val
()
==
'allot'
)
{
//选择房/客源
var
checkbox
=
$
(
'input[name="'
+
name
+
'[]"]'
);
if
(
checkbox
.
is
(
':checked'
))
{
var
array
=
[];
$
(
'input[name="'
+
name
+
'[]"]:checked'
).
map
(
function
()
{
var
consultant_id
=
Number
(
$
(
this
).
data
(
'consultant'
));
if
(
array
.
indexOf
(
consultant_id
)
==
-
1
)
{
array
.
push
(
consultant_id
);
}
});
var
confirmFlag
=
true
;
if
(
array
.
length
>
1
)
{
confirmFlag
=
confirm
(
'当前选择的房/客源置业顾问不同,是否继续'
);
}
if
(
confirmFlag
)
{
$
(
'#myConsultant'
).
modal
(
'show'
);
}
//未选择房/客源,下拉框显示批量操作
}
else
{
$
(
this
).
find
(
'option:first'
).
attr
(
'selected'
,
'selected'
);
alert
(
'请选择房/客源'
);
return
false
;
}
}
});
init_modal_myConsultantList
(
function
(
data
)
{
var
consultant_id
=
Number
(
data
.
id
);
$
(
'#allot_consultant_id'
).
val
(
consultant_id
);
});
$
(
"#myConsultant"
).
on
(
"hide.bs.modal"
,
function
()
{
var
allot_consultant_id
=
Number
(
$
(
'#allot_consultant_id'
).
val
());
if
(
!
allot_consultant_id
)
{
$
(
'select[name=action],select[name=action2]'
).
find
(
'option:first'
).
attr
(
'selected'
,
'selected'
);
}
});
}
wp-content/plugins/tospur/Admin/views/listBlock.html
View file @
bafaed0d
...
...
@@ -78,15 +78,20 @@
<input
type=
"hidden"
id=
"house_type"
value=
"{{house_type}}"
/>
<input
type=
"submit"
id=
"submit"
class=
"button action"
value=
"搜索"
>
<!-- Now we can render the completed list table -->
</form>
<form
method=
"post"
>
{% if house_type == 0 %}
{{function("addNewHouseTable")}}
{{function("addNewHouseTable")}}
{% elseif house_type == 1%}
{{function("addSecTable")}}
{{function("addSecTable")}}
{% else %}
{{function("addRentTable")}}
{{function("addRentTable")}}
{% endif %}
<input
type=
"hidden"
name=
"allot_consultant_id"
id=
"allot_consultant_id"
>
</form>
</div>
{% include 'recConsultant.html' %}
{{ block('recConsultant') }}
<script>
(
function
(
$
)
{
$
(
document
).
ready
(
function
(){
...
...
@@ -112,6 +117,12 @@
$
(
"#listDistrict"
).
change
(
function
(){
setArea
(
"listCity"
,
"listDistrict"
,
"listPlate"
);
})
{
%
if
house_type
==
1
%
}
allot_consultant
(
'sechandhouselist'
);
{
%
elseif
house_type
==
2
%
}
allot_consultant
(
'renthouselist'
);
{
%
endif
%
}
});
})(
jQuery
);
</script>
...
...
wp-content/plugins/tospur/Admin/views/selectOrganization.html
0 → 100644
View file @
bafaed0d
{% set organization = function('SearchDao::searchOrganization')|json_encode() %}
<div
id=
"organization"
style=
"margin-bottom: 10px;"
>
<span>
门店
</span>
<label
for=
"depth_1"
class=
"hidden"
></label>
<select
data-depth=
"1"
id=
"depth_1"
>
<option
value=
"-1"
>
请选择
</option>
</select>
<label
for=
"depth_2"
class=
"hidden"
></label>
<select
data-depth=
"2"
id=
"depth_2"
class=
"hidden"
>
<option
value=
"-1"
>
请选择
</option>
</select>
<label
for=
"depth_3"
class=
"hidden"
></label>
<select
data-depth=
"3"
id=
"depth_3"
class=
"hidden"
>
<option
value=
"-1"
>
请选择
</option>
</select>
<label
for=
"depth_4"
class=
"hidden"
></label>
<select
data-depth=
"4"
id=
"depth_4"
class=
"hidden"
>
<option
value=
"-1"
>
请选择
</option>
</select>
</div>
<script>
$
(
document
).
ready
(
function
()
{
var
organization
=
eval
(
'{{ organization }}'
);
$
.
each
(
organization
,
function
(
index
,
item
)
{
var
select
=
$
(
'#depth_'
+
item
.
Depth
);
var
css
=
''
;
if
(
item
.
Depth
!=
1
)
{
css
=
'class="hidden"'
;
}
select
.
append
(
'<option value="'
+
item
.
Id
+
'" data-parent="'
+
item
.
ParentId
+
'" '
+
css
+
'>'
+
item
.
Name
+
'</option>'
);
});
$
.
each
(
$
(
'select[data-depth]:not(:last)'
),
function
(
index
,
item
)
{
var
next_depth
=
Number
(
$
(
item
).
data
(
'depth'
))
+
1
;
var
next_select
=
$
(
'#depth_'
+
next_depth
);
$
(
item
).
change
(
function
()
{
var
parent_id
=
$
(
this
).
val
();
$
(
this
).
nextAll
().
find
(
'option:not(:first)'
).
addClass
(
'hidden'
);
$
(
this
).
nextAll
().
find
(
'option:first'
).
attr
(
'selected'
,
'selected'
);
$
(
this
).
nextAll
().
addClass
(
'hidden'
);
$
.
each
(
next_select
.
find
(
'option[data-parent='
+
parent_id
+
']'
),
function
(
index
,
item
)
{
$
(
item
).
removeClass
(
'hidden'
);
next_select
.
removeClass
(
'hidden'
);
});
});
});
var
search_organization
=
Number
(
'{{ req.organization }}'
);
if
(
search_organization
>
0
)
{
var
organization_select
=
$
(
'select[data-depth]'
);
var
search_option
=
organization_select
.
find
(
'option[value='
+
search_organization
+
']'
);
var
index
=
search_option
.
parent
().
index
(
'[data-depth]'
);
for
(
var
i
=
0
;
i
<=
index
;
i
++
)
{
var
option
=
organization_select
.
find
(
'option[value='
+
search_organization
+
']'
);
//显示 筛选门店
option
.
attr
(
'selected'
,
'selected'
);
search_organization
=
option
.
data
(
'parent'
);
//显示 筛选门店 相同parent门店
var
same_parent_option
=
organization_select
.
find
(
'option[data-parent='
+
search_organization
+
']'
);
same_parent_option
.
removeClass
(
'hidden'
);
//下拉框
option
.
parent
().
removeClass
(
'hidden'
);
}
}
});
function
getOrganization
()
{
return
Number
(
$
(
'select[data-depth]:not(.hidden):last'
).
val
());
}
</script>
\ No newline at end of file
wp-content/plugins/tospur/Dao/HouseDao.php
View file @
bafaed0d
...
...
@@ -22,4 +22,18 @@ class HouseDao {
return
$wpdb
->
last_error
;
return
$result
;
}
public
static
function
houseAllotConsultant
(
$consultant_id
,
$house_ids
)
{
if
(
$consultant_id
)
{
$string
=
'('
.
implode
(
','
,
array_map
(
'intval'
,
$house_ids
))
.
')'
;
global
$wpdb
;
$result
=
$wpdb
->
query
(
'update '
.
Config
::
A_HOUSE_USER_TABLE
.
' SET user_id = '
.
$consultant_id
.
' where house_id in '
.
$string
);
if
(
$result
){
echo
'<script>alert("分配置业顾问成功");</script>'
;
}
}
}
}
\ No newline at end of file
wp-content/plugins/tospur/Dao/InsertDao.php
View file @
bafaed0d
...
...
@@ -187,23 +187,26 @@ class InsertDao{
}
}
public
static
function
addRecConsultant
(
$houseId
,
$data
){
public
static
function
addRecConsultant
(
$houseId
,
$consultant
){
global
$wpdb
;
if
(
$
data
[
"recConsultant"
]
){
if
(
$
consultant
){
//插入推荐置业顾问user_id与新房id到关联表a_house_recommend
foreach
(
$
data
[
"recConsultant"
]
as
$val
){
foreach
(
$
consultant
as
$val
){
$a_house_userArray
=
array
(
"user_id"
=>
$val
,
"house_id"
=>
$houseId
,
"user_type"
=>
1
"user_type"
=>
1
);
$a_house_userRes
=
$wpdb
->
replace
(
Config
::
A_HOUSE_USER_TABLE
,
$a_house_userArray
);
if
(
!
$a_house_userRes
){
return
505
;
if
(
$a_house_userRes
){
return
$a_house_userRes
;
}
else
{
return
$wpdb
->
last_error
;
}
}
}
}
public
static
function
addHouseFeature
(
$houseId
,
$houseFeature
){
global
$wpdb
;
if
(
$houseFeature
){
...
...
wp-content/plugins/tospur/Dao/SearchDao.php
View file @
bafaed0d
...
...
@@ -133,7 +133,7 @@ class SearchDao
if
(
$parentId
!=
NULL
)
{
$where
.=
" and ParentId ="
.
$parentId
;
}
$result
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
'select
Id as id,Name as name
from '
.
Config
::
TOSPUR_ORGANIZATION_TABLE
.
$where
,
$parentId
));
$result
=
$wpdb
->
get_results
(
$wpdb
->
prepare
(
'select
*
from '
.
Config
::
TOSPUR_ORGANIZATION_TABLE
.
$where
,
$parentId
));
return
$result
;
}
...
...
@@ -477,4 +477,17 @@ class SearchDao
$results
=
$wpdb
->
get_row
(
$wpdb
->
prepare
(
$rentSql
,
$hid
));
return
$results
;
}
public
static
function
ajax_search_organization
()
{
wp_send_json
(
SearchDao
::
search_organization
());
}
public
static
function
search_organization
()
{
global
$wpdb
;
$rentSql
=
"SELECT * FROM tospur_organization where ParentId = 0 and Depth = 1;"
;
$results
=
$wpdb
->
get_row
(
$wpdb
->
prepare
(
$rentSql
,
$hid
));
return
$results
;
}
}
\ No newline at end of file
wp-content/plugins/tospur/Tools/TCSync.php
View file @
bafaed0d
...
...
@@ -41,7 +41,10 @@ class TCSync {
'cityId'
=>
$item
[
'CityId'
],
'imageUrl'
=>
$item
[
'ImageUrl'
],
'mobile'
=>
$item
[
'Mobile'
],
'name'
=>
$item
[
'Name'
]
'name'
=>
$item
[
'Name'
],
'subsidiaryId'
=>
$item
[
'SubsidiaryId'
],
'filedNameId'
=>
$item
[
'FiledNameId'
],
'filedName'
=>
$item
[
'FiledName'
]
);
$wpdb
->
query
(
TCSync
::
create_insert_update_sql
(
Config
::
TOSPUR_CONSULTANT
,
$info
,
array
(
'id'
)));
}
...
...
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