Commit 5e3f9b4f authored by hujun's avatar hujun

通话记录电话跟进

parent 577e2a8c
......@@ -39,7 +39,7 @@ class CellPhone extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$report = new SecretReport();
$field = 'agents_id,users_id,call_type,call_time,time,voice_file,c.user_status,a.id,a.create_time,a.type,secret_no,d.content';
$field = 'agents_id,users_id,call_type,call_time,time,voice_file,c.user_status,a.id,a.create_time,a.type,secret_no';
$where = [];
if (!empty($this->params['start_date'])) {
......
......@@ -28,7 +28,7 @@ class SecretReport extends BaseModel
$data = $this->field($field)->alias('a')
->join('a_agents b','a.agents_id=b.id','left')
->join('u_users c','a.users_id=c.id','left')
->join('u_phone_follow_up d','d.user_id=c.id','left')
->where($params)
->order($order_)
->limit($pageSize)
......@@ -54,10 +54,13 @@ class SecretReport extends BaseModel
$user_data = Db::table('u_users')->field('user_name,user_phone')->where('id',$v->users_id)->find();
$user_data['user_name'] = empty($user_data['user_name']) ? '?.?' : $user_data['user_name'];
$result[$k]['user_name'] = $user_data['user_name'] .'-'. hide_customer_phone($user_data['user_phone']);
// $result[$k]['follow_up'] = Db::table('u_phone_follow_up')->where('user_id',$v->users_id)->order('id DESC')->value('content');
$where_follow['user_id'] = $v->users_id;
$where_follow['type'] = 0;
$where_follow['agent_id'] = $v['agents_id'];
$result[$k]['content'] = Db::table('u_phone_follow_up')->where($where_follow)->order('id DESC')->value('content');
} else {
$result[$k]['user_nick'] = "";
$result[$k]['follow_up'] = "";
$result[$k]['content'] = "";
}
if ($v->voice_file) {
......@@ -102,7 +105,6 @@ class SecretReport extends BaseModel
return $this->alias('a')
->join('a_agents b','a.agents_id=b.id','left')
->join('u_users c','a.users_id=c.id','left')
->join('u_phone_follow_up d','d.user_id=c.id','left')
->where($params)
->count();
}
......
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