Commit 8479b739 authored by hujun's avatar hujun

log error edit

parent 9e152386
......@@ -117,45 +117,33 @@ class Client extends Basic
*/
public function agentUserTb(){
header('Access-Control-Allow-Origin:*');
$table= new Users;
$table = new Users;
$data['msg'] = '';
$time=date("Y-m-d H:i:s",time());//当前时间
$time = date("Y-m-d H:i:s",time());//当前时间
$params = $this->request->param();
$search=$params['search'];
if(empty($params['agent_id'])){
return $this->response(100,'参数不全');
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
//条件
//time_minute_diff 时间差(分)48小时内增加的【拥有经纪人】的客户为--受保护客户
$field = ['id as user_id','user_nick','user_phone','agent_id','referrer_id','create_time',"TIMESTAMPDIFF(MINUTE,create_time,'{$time}')as time_minute_diff"];
$where = " agent_id in({$params['agent_id']}) ";
$field=['id as user_id',
'user_nick',
'user_phone',
'agent_id',
'referrer_id',
'create_time',
"TIMESTAMPDIFF(MINUTE,create_time,'{$time}')as time_minute_diff"];
$where=" agent_id in({$params['agent_id']}) ";
if(!empty($search)){
if(!empty($params['search'])){
//搜索客户--可以搜索自己的客户and 不在保护期的客户
$where =" (agent_id in(0,{$params['agent_id']}) or agent_id is null or TIMESTAMPDIFF(MINUTE,create_time,'{$time}') > 2880 )
and ( user_nick like '%$search%' or user_phone like '%$search%' ) ";
$data['search']=$search;
$where = " (agent_id in(0,{$params['agent_id']}) or agent_id is null or TIMESTAMPDIFF(MINUTE,create_time,'{$time}') > 2880 )
and ( user_nick like '%{$params['search']}%' or user_phone like '%{$params['search']}%' ) ";
$data['search'] = $params['search'];
}
// echo $where;exit;
$order="id desc";
$data['list']=$table->getAgentUserTb($pageNo, $pageSize,$order,$field, $where);
$total=$table->getMyUserCount($where);
$data['total']= ceil($total / $pageSize);
$data['page']=$pageNo;
$data['list'] = $table->getAgentUserTb($pageNo, $pageSize,'id desc',$field, $where);
$total = $table->getMyUserCount($where);
$data['total'] = ceil($total / $pageSize);
$data['page'] = $pageNo;
return $this->response(200,'成功',$data);
}
......
......@@ -140,6 +140,7 @@ class Broker extends Basic
case 2:
$res = $hg->addAgents($this->params['agents_id'], $this->params['houses_id'], $this->params['type']);break;
default :
$res = [];
$data['status'] = 101;
$data['msg'] = 'type is null';
}
......
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