Commit f14a733a authored by zhuwei's avatar zhuwei

客户详情上一页下一页接口修改

parent 32771c62
...@@ -162,7 +162,7 @@ class User extends Basic ...@@ -162,7 +162,7 @@ class User extends Basic
} }
//todo 判断是 杭州还是上海 //todo 判断是 杭州还是上海
$where['city'] = '上海市'; $where['city'] = trim($this->city);
if ($params['type'] == 'last'){ if ($params['type'] == 'last'){
$where['id'] = ['gt',$params['user_id']]; $where['id'] = ['gt',$params['user_id']];
}else{ }else{
...@@ -172,24 +172,29 @@ class User extends Basic ...@@ -172,24 +172,29 @@ class User extends Basic
$field = 'id,user_nick,agent_id,vip'; $field = 'id,user_nick,agent_id,vip';
$user = new Users(); $user = new Users();
$user_res = $user->getLastOrNextUserID($where,$field,$limit=1); $user_res = $user->getLastOrNextUserID($where,$field,$limit=1);
if(!$user_res){
return $this->response("200", "不符合条件0", []);
}
//todo 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看 //todo 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看
//vip客户 0:否 1:是 //vip客户 0:否 1:是
if(($user_res['vip'] == 1) && ($user_res['agent_id'] != $params['agent_id'])){ if(($user_res['vip'] == 1) && ($user_res['agent_id'] != $params['agent_id'])){
return $this->response("200", "不符合条件", []); return $this->response("200", "不符合条件1", []);
} }
//todo 判断 //todo 判断
$clientService = new ClientService(); $clientService = new ClientService();
if($clientService->dialTotal($params['user_id'])){ if(!$clientService->dialTotal($params['user_id'])){
return $this->response("200", "不符合条件", []); return $this->response("200", "不符合条件2", []);
} }
$where = []; $where = [];
$where['city'] = '上海市'; $where['city'] = trim($this->city);
$field = 'max(id) as max_id'; $field = 'max(id) as max_id';
$max_id = $user->getLastOrNextUserID($where,$field,$limit=''); $max_id = $user->getLastOrNextUserID($where,$field,$limit='');
return $this->response("200", "success!", ['user_id'=>$user_res[0]['id'],'max_user_id'=>$max_id[0]['max_id']]); $field = 'MIN(id) as min_id';
$min_id = $user->getLastOrNextUserID($where,$field,$limit='');
return $this->response("200", "success!", ['user_id'=>$user_res[0]['id'],'max_user_id'=>$min_id[0]['max_id'],'min_user_id'=>$max_id[0]['min_id']]);
} }
} }
\ No newline at end of file
...@@ -38,6 +38,7 @@ class ClientService ...@@ -38,6 +38,7 @@ class ClientService
$params["user_id"] = $user_id; $params["user_id"] = $user_id;
$total = $this->uPhoneFollowUpModel->getCount( $params); $total = $this->uPhoneFollowUpModel->getCount( $params);
if ($total >= $num) { if ($total >= $num) {
return false; return false;
} else { } else {
......
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