Commit 103434cd authored by hujun's avatar hujun

跟进列表

parent 1ace4769
...@@ -13,6 +13,7 @@ use app\api_broker\service\ClientService; ...@@ -13,6 +13,7 @@ use app\api_broker\service\ClientService;
use app\extra\RedisExt; use app\extra\RedisExt;
use app\api_broker\service\VerifyRepetitionService; use app\api_broker\service\VerifyRepetitionService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\service\PhoneFollowUpService;
use app\index\service\UserService; use app\index\service\UserService;
use app\model\AAgents; use app\model\AAgents;
use app\model\AAgentsPhone; use app\model\AAgentsPhone;
...@@ -166,6 +167,64 @@ class Remark extends Basic ...@@ -166,6 +167,64 @@ class Remark extends Basic
return $this->response(200, '成功', $data); return $this->response(200, '成功', $data);
} }
/**
* 跟进列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function followUpListV2()
{
if (!$this->request->isAjax()) {
return view('remark_follow_index');
}
$m_user = new Users();
$m_label = new ULabels();
$m_agent = new AAgents();
$data['status'] = 200;
$data['msg'] = '';
$follow_up_service = new PhoneFollowUpService($this->siteId);
$where = [];
if (!empty($this->params['user_id'])) {
$where['user_id'] = $this->params['user_id'];
}
if (!empty($this->params['agent_id'])) {
$where['agent_id'] = $this->params['agent_id'];
}
$list = $follow_up_service->getPhoneFollowList($this->params['start_date'], $this->params['end_date'], $where, $this->userId);
$label_data = $m_label->getColumn('id,name', ['type'=>1]); //获取标签
if ($list['code'] == 200) {
foreach ($list as $k => $v) {
if (!empty($v['user_id'])) {
$user_data = $m_user->getUserById('user_name,user_phone,vip,agent_id,create_time', $v['user_id']);
$list[$k]['user_name'] = $user_data['user_name'];
$list[$k]['user_phone'] = $user_data['user_phone'];
$list[$k]['u_create_time'] = $user_data['create_time'];
$list[$k]['vip'] = $user_data['vip'];
$list[$k]['agent_id'] = $user_data['agent_id']; //客户客方
}
$list[$k]['user_phone'] = substr_replace($list[$k]['user_phone'], '****', 3, 4);
$list[$k]['admin'] = $m_agent->getAgentsById($v['agent_id'], 'name');
$data[$k]['label_name'] = array_key_exists($v['labels_id'], $label_data) ? $label_data[$v['labels_id']] : '';
}
$code = 200;
$msg = '';
} else {
$msg = $list['msg'];
$code = 101;
$list = [];
}
$data['data']['list'] = $list;
$data['data']['total'] = 40000;
return $this->response($code, $msg, $data);
}
/** /**
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
......
...@@ -30,12 +30,13 @@ class PhoneFollowUpService ...@@ -30,12 +30,13 @@ class PhoneFollowUpService
* @param string $end_time * @param string $end_time
* @param array $params * @param array $params
* @param string $field * @param string $field
* @return array|bool|false|\PDOStatement|string|\think\Collection * @param $agent_id
* @return array
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getPhoneFollowList(string $start_time, string $end_time, array $params, $field = 'id,user_id,create_time,content,user_status,labels_id,agent_id',$agent_id) public function getPhoneFollowList(string $start_time, string $end_time, array $params, $agent_id, $field = 'id,user_id,create_time,content,user_status,labels_id,agent_id')
{ {
$vrs = new VerifyRepetitionService(); $vrs = new VerifyRepetitionService();
......
...@@ -199,7 +199,7 @@ Route::group('index', [ ...@@ -199,7 +199,7 @@ Route::group('index', [
'lable' => ['index/label/index', ['method' => 'get']], //标签列表 'lable' => ['index/label/index', ['method' => 'get']], //标签列表
'getDistrict' => ['index/District/getList', ['method' => 'get']], //获取部门列表 'getDistrict' => ['index/District/getList', ['method' => 'get']], //获取部门列表
//数据统计 //数据统计
'RemarkFollowList' => ['index/remark/followUpList', ['method' => 'get']],//跟进列表 'RemarkFollowList' => ['index/remark/followUpListV2', ['method' => 'get']],//跟进列表
'phone_list' => ['index/Phone/index', ['method' => 'get']],//隐私号码列表 'phone_list' => ['index/Phone/index', ['method' => 'get']],//隐私号码列表
'bindPhoneList' => ['index/Phone/bindPhoneList', ['method' => 'get']],//绑定的隐私号码列表 'bindPhoneList' => ['index/Phone/bindPhoneList', ['method' => 'get']],//绑定的隐私号码列表
'edit_aliYunPhone' => ['index/Phone/edit_aliYunPhone', ['method' => 'get|post']],//新增或编辑中间号 'edit_aliYunPhone' => ['index/Phone/edit_aliYunPhone', ['method' => 'get|post']],//新增或编辑中间号
......
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