Commit 1aa83cab authored by zfc's avatar zfc

跟进列表

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