完善通时统计

dev
曾超新 5 years ago
parent a979666fc7
commit 32e68064ff
  1. 18
      frontend/controllers/PhoneCenterController.php

@ -561,6 +561,24 @@ public function actionDownload(){
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$row['total_call_num'] = $item->totalCallNum($begin_date,$end_date);
$row['total_call_time_out'] = $item->totalCallTimeOut($begin_date,$end_date);
$row['total_call_time'] = $item->totalCallTime($begin_date,$end_date);
$row['call_in_total_num'] = $item->callInTotalNum($begin_date,$end_date);
$row['call_in_suc_num'] = $item->callInSucNum($begin_date,$end_date);
$row['call_in_suc_num_rate'] = number_format($item->callInTotalNum($begin_date,$end_date)? $item->callInSucNum($begin_date,$end_date)/$item->callInTotalNum($begin_date,$end_date) :0,2);
$row['call_out_total_num'] = $item->callOutTotalNum($begin_date,$end_date);
$row['call_out_suc_num'] = $item->callOutSucNum($begin_date,$end_date);
$row['call_out_suc_num_rate'] = number_format($item->callOutTotalNum($begin_date,$end_date)?$item->callOutSucNum($begin_date,$end_date)/$item->callOutTotalNum($begin_date,$end_date):0,2) ;
if($item->phoneStatus) {
if($item->phoneStatus->is_phone==1) {
$row['phone_status'] = '<div style="background: #00B83F;width: 50px;">通话中</div>';
} else {
$row['phone_status'] = '<div style="background: #b03d3d;width: 50px;">未通话</div>';
}
} else {
$row['phone_status'] = '<div style="background: #b03d3d;width: 50px;">未通话</div>';
}
$data['rows'][] = $row;
}

Loading…
Cancel
Save