Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
478c5a17
Commit
478c5a17
authored
Apr 17, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将经纪人所在城市的客户拍前面
parent
962d0453
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
User.php
application/api_broker/controller/User.php
+31
-3
No files found.
application/api_broker/controller/User.php
View file @
478c5a17
...
...
@@ -88,6 +88,8 @@ class User extends Basic
public
function
searchUser
()
{
$params
=
$this
->
params
;
// big_log($this->authToken);
// big_log(json_encode($params));
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//app_request_source_type 1:代表全部客户
...
...
@@ -193,15 +195,17 @@ class User extends Basic
}
}
}
big_log
(
json_encode
(
$conditions
));
$field
=
"id as user_id,sex,user_name,city,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip,user_label,source_intro,site_ids"
;
$return_user_list
=
$this
->
userModel
->
selectUserList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
,
"id desc"
);
if
(
empty
(
$return_user_list
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
//
搜索将本城市的客户排
前面
if
(
$app_request_source_type
==
1
)
{
//todo 搜索将本城市的客户排前面
//
todo 将经纪人所在城市的客户拍
前面
if
(
$app_request_source_type
==
0
)
{
$return_user_list
=
$this
->
userSequenceByCity
(
$return_user_list
,
$params
[
'site_id'
]);
}
...
...
@@ -242,6 +246,30 @@ class User extends Basic
}
/**
* 将经纪人所在城市的客户拍前面
* @param $user_list
* @return mixed
*/
public
function
userSequenceByCity
(
$user_list
,
$site_id
)
{
if
(
!
$user_list
or
!
$site_id
)
{
return
false
;
}
$user_list_temp
=
[];
foreach
(
$user_list
as
$k
=>
$v
)
{
$site_ids_arr
=
explode
(
','
,
$v
[
'site_ids'
]);
if
(
in_array
(
$site_id
,
$site_ids_arr
))
{
$user_list_temp
[]
=
$v
;
unset
(
$user_list
[
$k
]);
}
}
return
$user_list_temp
+
$user_list
;
}
/**
* 客户详情上一页下一页接口
* @return \think\Response
...
...
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