Commit 8295eebc authored by zhuwei's avatar zhuwei

1

parent ef1e12e9
......@@ -92,11 +92,52 @@ 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 = [];
switch ($app_request_source_type) {
case 0:
if (isset($params['id'])) {
$conditions['id'] = $params['id'];
}
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 (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'];
}
......@@ -206,6 +247,10 @@ class User extends Basic
$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']);*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment