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
8295eebc
Commit
8295eebc
authored
Jun 18, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ef1e12e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
93 deletions
+138
-93
User.php
application/api_broker/controller/User.php
+138
-93
No files found.
application/api_broker/controller/User.php
View file @
8295eebc
...
...
@@ -92,120 +92,165 @@ class User extends Basic
$params
=
$this
->
params
;
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
#接口调用类型 0:客户搜索 1:全部客户 2
:
我的客户
$app_request_source_type
=
!
empty
(
$params
[
"app_request_source_type"
])
?
$params
[
"app_request_source_type"
]
:
0
;
#接口调用类型 0:客户搜索 1:全部客户 2
:
我的客户
$app_request_source_type
=
isset
(
$params
[
"app_request_source_type"
])
&&
is_numeric
(
$params
[
"app_request_source_type"
])
?
$params
[
"app_request_source_type"
]
:
1
;
$conditions
=
[];
if
(
isset
(
$params
[
'user_status'
]))
{
$conditions
[
'user_status'
]
=
$params
[
'user_status'
];
}
$is_search
=
false
;
switch
(
$app_request_source_type
)
{
case
0
:
if
(
isset
(
$params
[
'id'
]))
{
$conditions
[
'id'
]
=
$params
[
'id'
];
}
if
(
isset
(
$params
[
'id'
]))
{
$conditions
[
'id'
]
=
$params
[
'id'
];
$is_search
=
true
;
}
if
(
isset
(
$params
[
'user_name'
]))
{
if
(
strlen
(
$params
[
'user_name'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_name'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_name'
])
.
"%"
);
}
if
(
isset
(
$params
[
'user_nick'
]))
{
if
(
strlen
(
$params
[
'user_nick'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_nick'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_nick'
])
.
"%"
);
}
if
(
isset
(
$params
[
'user_phone'
]))
{
if
(
!
is_numeric
(
$params
[
'user_phone'
]))
{
return
$this
->
response
(
101
,
'请输入正确手机号'
);
}
if
(
isset
(
$params
[
'user_name'
]))
{
if
(
strlen
(
$params
[
'user_name'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_name'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_name'
])
.
"%"
);
$is_search
=
true
;
}
if
(
isset
(
$params
[
'user_nick'
]))
{
if
(
strlen
(
$params
[
'user_nick'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_nick'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_nick'
])
.
"%"
);
$is_search
=
true
;
}
if
(
isset
(
$params
[
'user_phone'
]))
{
if
(
!
is_numeric
(
$params
[
'user_phone'
]))
{
return
$this
->
response
(
101
,
'请输入正确手机号'
);
}
if
(
strlen
(
$params
[
'user_phone'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
if
(
strlen
(
$params
[
'user_phone'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_phone'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
}
break
;
case
2
:
$conditions
[
'agent_id'
]
=
$params
[
'agent_id'
];
if
(
isset
(
$params
[
'user_status'
]))
{
$conditions
[
'user_status'
]
=
$params
[
'user_status'
];
}
if
(
isset
(
$params
[
'entrust_type'
])
&&
is_numeric
(
$params
[
'entrust_type'
])
&&
(
$app_request_source_type
==
1
)){
//委托类型
$conditions
[
'entrust_type'
]
=
$params
[
'entrust_type'
];
}
break
;
default
:
if
(
isset
(
$params
[
'user_status'
]))
{
$conditions
[
'user_status'
]
=
$params
[
'user_status'
];
}
$is_search
=
false
;
$conditions
[
'user_phone'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
$is_search
=
true
;
}
if
(
isset
(
$params
[
'yetai'
]))
{
$conditions
[
'industry_type'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'yetai'
])
.
"%"
);
}
if
(
isset
(
$params
[
'id'
]))
{
$conditions
[
'id'
]
=
$params
[
'id'
];
$is_search
=
true
;
}
$area_start
=
isset
(
$params
[
'area_start'
])
?
$params
[
'area_start'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'area_end'
])
?
$params
[
'area_end'
]
:
-
1
;
if
(
isset
(
$params
[
'user_name'
]))
{
if
(
strlen
(
$params
[
'user_name'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_name'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_name'
])
.
"%"
);
$is_search
=
true
;
}
if
(
isset
(
$params
[
'user_nick'
]))
{
if
(
strlen
(
$params
[
'user_nick'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$conditions
[
'user_nick'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_nick'
])
.
"%"
);
$is_search
=
true
;
}
if
(
isset
(
$params
[
'user_phone'
]))
{
if
(
!
is_numeric
(
$params
[
'user_phone'
]))
{
return
$this
->
response
(
101
,
'请输入正确手机号'
);
}
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
$conditions
[
'area_demand'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
}
else
if
(
$area_start
>=
0
&&
$area_end
<
0
)
{
//100米以上不用传结束面积
$conditions
[
'area_demand'
]
=
array
(
'egt'
,
$area_start
);
}
if
(
strlen
(
$params
[
'user_phone'
])
>
20
)
{
return
$this
->
response
(
101
,
'输入内容长度超限'
);
}
$price_start
=
isset
(
$params
[
'money_start'
])
?
$params
[
'money_start'
]
:
-
1
;
$price_end
=
isset
(
$params
[
'money_end'
])
?
$params
[
'money_end'
]
:
-
1
;
$conditions
[
'user_phone'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
$is_search
=
true
;
}
if
(
isset
(
$params
[
'yetai'
]))
{
$conditions
[
'industry_type'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'yetai'
])
.
"%"
);
}
if
(
$price_start
>=
0
&&
$price_end
>=
0
)
{
//金额
$conditions
[
'price_demand'
]
=
array
(
'between'
,
array
(
$price_start
,
$price_end
)
);
}
else
if
(
$price_start
>=
0
&&
$price_end
<
0
)
{
$conditions
[
'price_demand'
]
=
array
(
'egt'
,
$price_start
);
}
$area_start
=
isset
(
$params
[
'area_start'
])
?
$params
[
'area_start'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'area_end'
])
?
$params
[
'area_end'
]
:
-
1
;
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
$start_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'start_time'
]
);
$end_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'end_time'
]);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
$conditions
[
'area_demand'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
}
else
if
(
$area_start
>=
0
&&
$area_end
<
0
)
{
//100米以上不用传结束面积
$conditions
[
'area_demand'
]
=
array
(
'egt'
,
$area_start
);
}
if
(
isset
(
$params
[
'status'
]))
{
$conditions
[
'status'
]
=
$params
[
'status'
];
}
//是否vip客户 1是 0否
if
(
isset
(
$params
[
'is_vip'
])
)
{
$conditions
[
'vip'
]
=
$params
[
'is_vip'
];
}
$price_start
=
isset
(
$params
[
'money_start'
])
?
$params
[
'money_start'
]
:
-
1
;
$price_end
=
isset
(
$params
[
'money_end'
])
?
$params
[
'money_end'
]
:
-
1
;
//传了经纪人id则表示我的客户
if
(
isset
(
$params
[
"agent_id"
]))
{
$conditions
[
'agent_id'
]
=
$params
[
'agent_id'
];
if
(
$price_start
>=
0
&&
$price_end
>=
0
)
{
//金额
$conditions
[
'price_demand'
]
=
array
(
'between'
,
array
(
$price_start
,
$price_end
)
);
}
else
if
(
$price_start
>=
0
&&
$price_end
<
0
)
{
$conditions
[
'price_demand'
]
=
array
(
'egt'
,
$price_start
);
}
//是我的客户就显示全部
}
else
{
if
(
$app_request_source_type
==
1
){
#全部客户列表 排除排除纯房东客户
$conditions
[
'user_label'
]
=
array
(
"neq"
,
2
);
#根据时间搜索,要能搜到保护期客户
if
(
!
$is_search
&&
!
isset
(
$conditions
[
'create_time'
])){
#排除排除保护期内的客户 将截止日期大于当前时间的数据排除掉
$time_now
=
date
(
'Y-m-d H:i:s'
);
$conditions
[
'protect_time'
]
=
array
(
'lt'
,
$time_now
);
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
$start_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'start_time'
]);
$end_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'end_time'
]);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
#站点的客户
if
(
isset
(
$params
[
'site_id'
])
)
{
#根据前端选择站点客户
$conditions
[
'site_ids'
]
=
[
'LIKE'
,
'%'
.
$params
[
'site_id'
]
.
'%'
];
if
(
isset
(
$params
[
'status'
]))
{
$conditions
[
'status'
]
=
$params
[
'status'
];
}
//是否vip客户 1是 0否
if
(
isset
(
$params
[
'is_vip'
])
)
{
$conditions
[
'vip'
]
=
$params
[
'is_vip'
];
}
//传了经纪人id则表示我的客户
if
(
isset
(
$params
[
"agent_id"
]))
{
$conditions
[
'agent_id'
]
=
$params
[
'agent_id'
];
//是我的客户就显示全部
}
else
{
#前端不穿站点参数就默认显示经纪人所在站点的客户
$conditions
[
'site_ids'
]
=
[
'LIKE'
,
'%'
.
$this
->
siteId
.
'%'
];
if
(
$app_request_source_type
==
1
){
#全部客户列表 排除排除纯房东客户
$conditions
[
'user_label'
]
=
array
(
"neq"
,
2
);
#根据时间搜索,要能搜到保护期客户
if
(
!
$is_search
&&
!
isset
(
$conditions
[
'create_time'
])){
#排除排除保护期内的客户 将截止日期大于当前时间的数据排除掉
$time_now
=
date
(
'Y-m-d H:i:s'
);
$conditions
[
'protect_time'
]
=
array
(
'lt'
,
$time_now
);
}
#站点的客户
if
(
isset
(
$params
[
'site_id'
])
)
{
#根据前端选择站点客户
$conditions
[
'site_ids'
]
=
[
'LIKE'
,
'%'
.
$params
[
'site_id'
]
.
'%'
];
}
else
{
#前端不穿站点参数就默认显示经纪人所在站点的客户
$conditions
[
'site_ids'
]
=
[
'LIKE'
,
'%'
.
$this
->
siteId
.
'%'
];
}
}
}
}
}
if
((
$app_request_source_type
==
0
)
&&
(
!
isset
(
$params
[
"agent_id"
])))
{
$pageNo
=
1
;
$pageSize
=
50
;
}
if
((
$app_request_source_type
==
0
)
&&
(
!
isset
(
$params
[
"agent_id"
])))
{
$pageNo
=
1
;
$pageSize
=
50
;
}
if
(
isset
(
$params
[
'entrust_type'
])
&&
is_numeric
(
$params
[
'entrust_type'
])
&&
(
$app_request_source_type
==
1
)){
//委托类型
$conditions
[
'entrust_type'
]
=
$params
[
'entrust_type'
];
}
if
(
isset
(
$params
[
'entrust_type'
])
&&
is_numeric
(
$params
[
'entrust_type'
])
&&
(
$app_request_source_type
==
1
)){
//委托类型
$conditions
[
'entrust_type'
]
=
$params
[
'entrust_type'
];
}
$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,entrust_type,concrete_industry"
;
$return_user_list
=
$this
->
userModel
->
selectUserList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
,
"id desc"
);
...
...
@@ -571,7 +616,7 @@ class User extends Basic
return
$this
->
response
(
"201"
,
"查无数据"
,
[
'user_id'
=>
$params
[
'user_id'
]
]);
}
// $model = new AAgents();
// $model = new AAgents();
/* $result = $model->searchAgentsByKeyword("id,name,phone", [ "id" => $params["agent_id"]]);
$call = new CallPhoneService();
$gresult = $call->getBindNum($user_res['user_phone'],$result[0]['phone']);*/
...
...
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