Commit 47429f09 authored by hujun's avatar hujun

拨打客户类型

parent 0c28c244
......@@ -12,6 +12,8 @@ use app\api_broker\service\CallPhoneService;
use app\api_broker\service\PushMessageService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\GLandlordPhone;
use app\model\OfficeGLandlordPhone;
use app\model\SecretReport;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
......@@ -44,7 +46,7 @@ class CellPhone extends Basic
$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,
a.phone_no,a.secret_no,c.id as user_id,c.agent_id as c_agent_id,c.vip,a.peer_no,a.create_time';
a.phone_no,a.secret_no,c.id as user_id,c.agent_id as c_agent_id,c.vip,a.peer_no,a.create_time,a.user_type';
$where = [];
if (!empty($this->params['start_date'])) {
......@@ -97,11 +99,13 @@ class CellPhone extends Basic
$list = $report->getCallList($pageNo, $pageSize, '', $field, $where);
$m_user = new Users();
$m_phone_follow = new UPhoneFollowUp($this->siteId);
if($this->params['end_date'] >= date('Y-m-d',time())){
$m_phone_follow_temp = new UPhoneFollowUpTemporary($this->siteId);
}
// $m_phone_follow = new UPhoneFollowUp($this->siteId);
// if($this->params['end_date'] >= date('Y-m-d',time())){
// $m_phone_follow_temp = new UPhoneFollowUpTemporary($this->siteId);
// }
$m_agent = new AAgents();
$m_landlord = new GLandlordPhone();
$m_landlord_office = new OfficeGLandlordPhone();
foreach ($list as $k => $v) {
if (empty($v['agents_id'])) {
$list[$k]['agents_name'] = $v['phone_no'];
......@@ -116,54 +120,46 @@ class CellPhone extends Basic
$list[$k]['voice_file'] = "";
}
$list[$k]['time'] = $v->time;
//主叫收费
// if ($v->call_type == 0) {
// if ($v->time > 0) {
// if ($v->time <= 60) {
// $time = 1; //不足一分钟按一分钟
// } else {
// $remainder = $v->time % 60;
// $time = 0;
// if ($remainder != 0) {
// $time += 1;
// }
// $time += floor($v->time/60);
// }
// $list[$k]['price'] = $time*0.06 + $time*0.05;//通话 0.06元/分,录音 0.05元/分
// } else {
// $list[$k]['price'] = 0;
// }
// } else {
// $list[$k]['price'] = 0;
// }
$list[$k]['time'] = $v['time'];
if (empty($v['call_time'])) {
$list[$k]['call_time'] = $v['create_time'];
}
if ($v['users_id']) {
$user_data = $m_user->selectUser($v['users_id'], 'user_name,user_phone');
$user_data['user_name'] = empty($user_data['user_name']) ? '?.?' : $user_data['user_name'];
$list[$k]['user_name'] = $user_data['user_name'] .'-'. substr_replace($user_data['user_phone'],'****',3,4);
$where_follow['user_id'] = $v['users_id'];
$where_follow['type'] = 0;
$where_follow['agent_id'] = $v['agents_id'];
if($this->params['end_date'] >= date('Y-m-d',time())){
$result[$k]['content'] = $m_phone_follow_temp->getUserFollowKey('content', $where_follow, 'id DESC');
if (empty($result[$k]['content'])) {
$result[$k]['content'] = $m_phone_follow->getUserFollowKey('content', $where_follow, 'id DESC');
}
}else{
$result[$k]['content'] = $m_phone_follow->getUserFollowKey('content', $where_follow, 'id DESC');
switch ($v['user_type']) {
case 0 :
$user_data = $m_user->selectUser($v['users_id'], 'user_name,user_phone');
$user_data['user_name'] = empty($user_data['user_name']) ? '?.?' : $user_data['user_name'];
$list[$k]['user_name'] = $user_data['user_name'] .'-'. substr_replace($user_data['user_phone'],'****',3,4);
// $where_follow['user_id'] = $v['users_id'];
// $where_follow['type'] = 0;
// $where_follow['agent_id'] = $v['agents_id'];
// if($this->params['end_date'] >= date('Y-m-d',time())){
// $list[$k]['content'] = $m_phone_follow_temp->getUserFollowKey('content', $where_follow, 'id DESC');
// if (empty($result[$k]['content'])) {
// $list[$k]['content'] = $m_phone_follow->getUserFollowKey('content', $where_follow, 'id DESC');
// }
// }else{
// $result[$k]['content'] = $m_phone_follow->getUserFollowKey('content', $where_follow, 'id DESC');
// }
break;
case 2 :
$landlord_data = $m_landlord->getInfo('name,phone', ['id'=>$v['users_id'],'status'=>0]);
$list[$k]['user_name'] = $landlord_data['name'] .'-'. substr_replace($landlord_data['phone'],'****',3,4);
break;
case 3 :
$landlord_office = $m_landlord_office->getAllList('name,phone',['id'=>$v['users_id']]);
$list[$k]['user_name'] = $landlord_office[0]['name'] .'-'. substr_replace($landlord_office[0]['phone'],'****',3,4);
break;
}
} else {
$result[$k]['user_nick'] = "";
$result[$k]['content'] = "";
$result[$k]['user_name'] = substr_replace($v['peer_no'], '****',3, 4);
unset($list[$k]['peer_no']);
$list[$k]['user_nick'] = "";
$list[$k]['content'] = "";
$list[$k]['user_name'] = substr_replace($v['peer_no'], '****',3, 4);
}
unset($list[$k]['peer_no']);
}
$data['list'] = $list;
// $data['total'] = $report->getCallListTotal($where);
......
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