Commit 645272c4 authored by zfc's avatar zfc Committed by hujun

客方搜索

parent 5f191fe4
......@@ -101,6 +101,34 @@ class Client extends Basic
return $this->response(200,'成功',$data);
}
/**经纪人搜索
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function agentSearch(){
$table= new Agents;
$data['msg'] = '';
$params = $this->request->param();
$search=$params['search'];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field=['id','realname','phone'];
$where='level in(2,5) ';
if(!empty($search)){
$where.=" and realname like '%$search%' or phone like '%$search%' ";
$data['search']=$search;
}
$order="id desc";
$data['list']=$table->searchList($pageNo, $pageSize,$order,$field, $where);
$total=$table->searchTotal($where);
$data['total']= ceil($total / $pageSize);
$data['page']=$pageNo;
return $this->response(200,'成功',$data);
}
/**app 经纪人用户列表
* @throws \think\db\exception\DataNotFoundException
......
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