Commit 1aa83cab authored by zfc's avatar zfc

跟进列表

parent f845aceb
......@@ -126,20 +126,25 @@ class Client extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field=['f.id',
'f.user_id',
'f.content',
'f.create_time',
'u.user_pic',
"TIMESTAMPDIFF(MINUTE,u.create_time,'{$time}')as time_minute_diff"
'img.imagename',
'a.realname',
'a.agentshopname',
'a.sub_shopname',
"TIMESTAMPDIFF(MINUTE,f.create_time,'{$time}')as time_minute_diff"
];
$where="agent_id in(0,{$params['agent_id']})
or TIMESTAMPDIFF(MINUTE,create_time,'{$time}') > 2880";
$where="(f.agent_id in(0,{$params['agent_id']}) ) ";
if(!empty($search)){
$where.=" and f.content like '%$search%' ";
$data['search']=$search;
}
$join=[['u_user u','u.id=f.user_id','left']];
$order="id asc";
$data['list']=$table->getSearch($pageNo, $pageSize,$order,$field,$join, $where);
$group=" f.id ";
$join=[['agents a','a.id=f.agent_id','left'],
['agentsimgs img','img.agent_id=f.agent_id','left']];
$order="id desc";
$data['list']=$table->getSearch($pageNo, $pageSize,$order,$field,$join, $where,$group);
$data['total']=$table->getUserAgentTotal($where,$join);
return $this->response(200,'成功',$data);
......
......@@ -31,11 +31,12 @@ class UPhoneFollowPp extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSearch($p = 1, $pageSize = 15, $order_= 'id desc',$field,$join, $where){
public function getSearch($p = 1, $pageSize = 15, $order_= 'id desc',$field,$join, $where,$group){
$r = $this->field($field)
->alias('f')
->join($join)
->where($where)
->group($group)
->order($order_)
->limit($pageSize)
->page($p)
......
......@@ -207,7 +207,7 @@ Route::group('api', [
'getVersionNo' => [ 'api/Version/getVersionNo', [ 'method' => 'post' ] ],
'agentUserTb' => [ 'api_broker/Client/agentUserTb', [ 'method' => 'get' ] ],//客户列表
'agentUserFollow' => [ 'api_broker/Client/agentUserFollow', [ 'method' => 'get' ] ],//客户列表
]);
......
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