Exemplo n.º 1
0
 /**
  * 超时回复列表
  */
 public function actionTimeoutReply()
 {
     #------初始化------#
     $this->_loadCore('Help_Page');
     $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $qualityStatus = $this->_getGlobalData('quality_status');
     $qualityOptions = $this->_getGlobalData('quality_options');
     #------初始化------#
     $users = $this->_getGlobalData('user');
     $allUser = Model::getTtwoArrConvertOneArr($users, 'user_name', 'nick_name');
     $helpSqlSearch->set_tableName($this->_modelWorkOrderQa->tName());
     $helpSqlSearch->set_conditions('is_timeout=1');
     $helpSqlSearch->set_conditions('qa=1');
     $helpSqlSearch->set_orderBy('create_time desc');
     $helpSqlSearch->setPageLimit($_GET['page'], 20);
     $allConditions = $helpSqlSearch->get_conditions();
     //返回所有条件
     $helpPage = new Help_Page(array('total' => $this->_modelWorkOrderQa->findCount($allConditions), 'perpage' => 20));
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelWorkOrderQa->select($sql);
     if ($dataList) {
         Tools::import('Util_FontColor');
         foreach ($dataList as &$value) {
             $value['word_is_quality'] = $value['is_quality'] ? $users[$value['is_quality']]['nick_name'] : '<font color="#666666">未质检</font>';
             $value['word_reply_name'] = $allUser[$value['reply_name']];
             $value['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
             $value['last_reply_time'] = date('Y-m-d H:i:s', $value['last_reply_time']);
             $value['url_detail'] = Tools::url('QualityCheck', 'Dialog', array('Id' => $value['work_order_id'], 'game_type_id' => $value['game_type_id'], 'operator_id' => $value['operator_id']));
             $value['content'] = strip_tags($value['content']);
         }
         $this->_view->assign('dataList', $dataList);
     }
     $this->_view->assign('pageBox', $helpPage->show());
     $this->_view->assign('js', $this->_view->get_curJs());
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
 public function actionWorkOrderStatus()
 {
     $workOrderId = intval($_REQUEST['work_order_id']);
     if (!$workOrderId) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'Work Order Id Empty', 'data' => null));
     }
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $gameId = intval($_REQUEST['game_id']);
     $sql_CheckWorkOrder = "select * from {$this->_modelWorkOrder->tName()} where Id={$workOrderId} and game_type={$gameId}";
     $workOrderData = $this->_modelWorkOrder->select($sql_CheckWorkOrder, 1);
     if (!$workOrderData) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'workorder non-exist', 'data' => null));
     }
     //if($workOrderData['is_read'] == 0){
     //	$this->_modelWorkOrder->update(array('is_read'=>1),"Id={$workOrderId}");//更改已读状态
     //}
     $workOrderData['status'] = min(3, $workOrderData['status']);
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $sql = "select work_order_id,content,create_time from " . $this->_modelWorkOrderQa->tName() . " where work_order_id={$workOrderId} order by create_time ";
     $dataList = $this->_modelWorkOrderQa->select($sql, 1);
     $dataList['status'] = $workOrderData['status'];
     $this->_returnAjaxJson(array('status' => 1, 'info' => CONTROL . '_' . ACTION, 'data' => $dataList));
 }
Exemplo n.º 3
0
 /**
  * 统计并且存入表.
  * key=0的为总数,其它的都会user_id,统计完成后会自动入库.
  * @param int $startTime
  * @param int $endTime
  */
 public function user($startTime, $endTime)
 {
     $addArrs = array();
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $workOrderList = $this->_modelWorkOrder->select("select * from {$this->_modelWorkOrder->tName()} where create_time between {$startTime} and {$endTime}");
     if ($workOrderList) {
         foreach ($workOrderList as $list) {
             $addArrs[0]['game_type_num'][$list['game_type']]++;
             $addArrs[0]['question_type_num'][$list['question_type']]++;
             $addArrs[0]['source_num'][$list['source']]++;
             $addArrs[0]['operator_num'][$list['operator_id']]++;
             $addArrs[0]['vip_level_num'][$list['vip_level']]++;
             $addArrs[0]['evaluation_num'][$list['evaluation_status']]++;
             $curUserId = $list['owner_user_id'];
             $addArrs[$curUserId]['game_type_num'][$list['game_type']]++;
             //游戏类型计数
             $addArrs[$curUserId]['question_type_num'][$list['question_type']]++;
             //问题类型计数
             $addArrs[$curUserId]['source_num'][$list['source']]++;
             //来源计数
             $addArrs[$curUserId]['operator_num'][$list['operator_id']]++;
             //运营商计数
             $addArrs[$curUserId]['vip_level_num'][$list['vip_level']]++;
             //VIP等级计数
             $addArrs[$curUserId]['evaluation_num'][$list['evaluation_status']]++;
             //评价计数
         }
     }
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $workOrderQaList = $this->_modelWorkOrderQa->select("select * from {$this->_modelWorkOrderQa->tName()} where create_time between {$startTime} and {$endTime} and qa=1");
     if ($workOrderQaList) {
         foreach ($workOrderQaList as $list) {
             $curUserId = $list['user_id'];
             $list['is_quality'] = $list['is_quality'] ? '1' : '0';
             $addArrs[0]['reply_quality_num'][$list['is_quality']]++;
             //总数,被质检增加
             $addArrs[$curUserId]['reply_quality_num'][$list['is_quality']]++;
             //用户被质检数增加
             if ($list['is_timeout'] != null) {
                 $addArrs[0]['reply_timeout_num'][$list['is_timeout']]++;
                 //总数超时,增加
                 $addArrs[$curUserId]['reply_timeout_num'][$list['is_timeout']]++;
                 //用户超时,增加
             }
         }
     }
     $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object');
     $qualityList = $this->_modelQuality->select("select * from {$this->_modelQuality->tName()} where quality_time between {$startTime} and {$endTime}");
     if ($qualityList) {
         foreach ($qualityList as $list) {
             $curUserId = $list['quality_user_id'];
             $addArrs[0]['quality_option_num'][$list['option_id']]++;
             $addArrs[0]['quality_status_num'][$list['status']]++;
             $addArrs[$curUserId]['quality_option_num'][$list['option_id']]++;
             $addArrs[$curUserId]['quality_status_num'][$list['status']]++;
             if ($list['scores'] > 0) {
                 $addArrs[0]['quality_scores']['bonus'] += $list['scores'];
                 $addArrs[0]['quality_scores']['bonus_num']++;
                 $addArrs[$curUserId]['quality_scores']['bonus'] += $list['scores'];
                 $addArrs[$curUserId]['quality_scores']['bonus_num']++;
             } else {
                 $addArrs[0]['quality_scores']['deeduction'] += $list['scores'];
                 $addArrs[0]['quality_scores']['deeduction_num']++;
                 $addArrs[$curUserId]['quality_scores']['deeduction'] += $list['scores'];
                 $addArrs[$curUserId]['quality_scores']['deeduction_num']++;
             }
         }
     }
     $insertArr = array();
     foreach ($addArrs as $key => $list) {
         if ($key === '' || $key === null) {
             continue;
         }
         $list['user_id'] = $key;
         $list['create_time'] = $startTime;
         $list['game_type_num'] = serialize((array) $list['game_type_num']);
         $list['question_type_num'] = serialize((array) $list['question_type_num']);
         $list['source_num'] = serialize((array) $list['source_num']);
         $list['operator_num'] = serialize((array) $list['operator_num']);
         $list['vip_level_num'] = serialize((array) $list['vip_level_num']);
         $list['evaluation_num'] = serialize((array) $list['evaluation_num']);
         $list['reply_quality_num'] = serialize((array) $list['reply_quality_num']);
         $list['reply_timeout_num'] = serialize((array) $list['reply_timeout_num']);
         $list['quality_option_num'] = serialize((array) $list['quality_option_num']);
         $list['quality_status_num'] = serialize((array) $list['quality_status_num']);
         $list['quality_scores'] = serialize((array) $list['quality_scores']);
         $this->add($list);
         array_push($insertArr, $list);
     }
 }
Exemplo n.º 4
0
 /**
  * 根据用户统计 
  */
 private function _getStatusUser()
 {
     if (is_array($this->_users)) {
         $users = implode(',', $this->_users);
     } else {
         $users = $this->_users;
     }
     $addArrs = array();
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $sql = "select Id,game_type,question_type,source,operator_id,vip_level,evaluation_status,evaluation_desc,create_time from {$this->_modelWorkOrder->tName()} where create_time between {$this->_statsTime['start']} and {$this->_statsTime['end']} and owner_user_id in (" . $users . ")";
     $gameType = NULL;
     if ($this->_gameType) {
         if (is_array($this->_gameType)) {
             $gameType = implode(',', $this->_gameType);
         }
         $sql .= " and game_type in ({$gameType})";
     }
     $workOrderList = $this->_modelWorkOrder->select($sql);
     if ($workOrderList) {
         //1游戏BUG
         //2游戏设置不满意
         //3回复不清晰
         //4回复错误
         //5客服服务态度恶劣
         //6其他
         $evaluationDesc = array(1 => 32, 2 => 32, 3 => 3, 4 => 3, 5 => 3, 6 => 32, '' => 3);
         //32扩展为游戏差评、3保留为服务差评
         foreach ($workOrderList as $list) {
             $addArrs['game_type_num'][$list['game_type']]++;
             $addArrs['question_type_num'][$list['question_type']]++;
             $addArrs['source_num'][$list['source']]++;
             $addArrs['operator_num'][$list['operator_id']]++;
             $addArrs['vip_level_num'][$list['vip_level']]++;
             //对差评进行扩展
             if ($list['evaluation_status'] == 3) {
                 $addArrs['evaluation_num'][$evaluationDesc[$list['evaluation_desc']]]++;
                 $addArrs['evaluation_desc_num'][$list['evaluation_desc']]++;
             } else {
                 $addArrs['evaluation_num'][$list['evaluation_status']]++;
             }
             //				$addArrs['evaluation_num'][$list['evaluation_status']]++;
             //				if ($list['evaluation_desc'])$addArrs['evaluation_desc_num'][$list['evaluation_desc']]++;
         }
         $isEvNum = $addArrs['evaluation_num'][1] + $addArrs['evaluation_num'][2] + $addArrs['evaluation_num'][3] + $addArrs['evaluation_num'][32];
         $addArrs['evaluation_num']['satisfaction'] = $addArrs['evaluation_num'][1] / ($isEvNum - $addArrs['evaluation_num'][32]) * 100;
         //服务满意度
         $totalEvNum = $addArrs['evaluation_num'][0] + $isEvNum;
         $addArrs['evaluation_num']['ev_percentage'] = $isEvNum / $totalEvNum * 100;
         //评价率
     }
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $sql = "select Id,is_quality,is_timeout,create_time from {$this->_modelWorkOrderQa->tName()} where create_time between {$this->_statsTime['start']} and {$this->_statsTime['end']} and qa=1 and user_id in (" . $users . ")";
     if ($gameType) {
         $sql .= " and game_type_id in ({$gameType})";
     }
     $workOrderQaList = $this->_modelWorkOrderQa->select($sql);
     if ($workOrderQaList) {
         foreach ($workOrderQaList as $list) {
             $list['is_quality'] = $list['is_quality'] ? '1' : '0';
             $addArrs['reply_quality_num'][$list['is_quality']]++;
             //总数,被质检增加
             if ($list['is_timeout'] != null) {
                 $addArrs['reply_timeout_num'][$list['is_timeout']]++;
                 //总数超时,增加
             }
         }
     }
     $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object');
     $sql = "select option_id,status,scores from {$this->_modelQuality->tName()} where quality_time between {$this->_statsTime['start']} and {$this->_statsTime['end']} and  (quality_user_id in ({$users}) or reply_user_id in ({$users})) ";
     if ($gameType) {
         $sql .= " and game_type_id in ({$gameType})";
     }
     $qualityList = $this->_modelQuality->select($sql);
     if ($qualityList) {
         foreach ($qualityList as $list) {
             $addArrs['quality_option_num'][$list['option_id']]++;
             $addArrs['quality_status_num'][$list['status']]++;
             if ($list['scores'] > 0) {
                 $addArrs['quality_scores']['bonus'] += $list['scores'];
                 $addArrs['quality_scores']['bonus_num']++;
             } elseif ($list['scores'] < 0) {
                 $addArrs['quality_scores']['deeduction'] += $list['scores'];
                 $addArrs['quality_scores']['deeduction_num']++;
             }
         }
     }
     foreach ($addArrs as $key => &$list) {
         $list['game_type_num'] = (array) $list['game_type_num'];
         $list['question_type_num'] = (array) $list['question_type_num'];
         $list['source_num'] = (array) $list['source_num'];
         $list['operator_num'] = (array) $list['operator_num'];
         $list['vip_level_num'] = (array) $list['vip_level_num'];
         $list['evaluation_num'] = (array) $list['evaluation_num'];
         $list['reply_quality_num'] = (array) $list['reply_quality_num'];
         $list['reply_timeout_num'] = (array) $list['reply_timeout_num'];
         $list['quality_option_num'] = (array) $list['quality_option_num'];
         $list['quality_status_num'] = (array) $list['quality_status_num'];
         $list['quality_scores'] = (array) $list['quality_scores'];
     }
     return $addArrs;
 }
Exemplo n.º 5
0
 /**
  * 详细统计
  * @param array  $date
  * @param array $users
  */
 public function statsDetail($date, $users, $gameIds = NULL, $operators = null)
 {
     #------获取工单总数统计------#
     $sql = "select evaluation_status,evaluation_desc,create_time,owner_user_id,is_verify,status from {$this->tName()} where create_time between {$date['start']} and {$date['end']} and owner_user_id in (" . implode(',', $users) . ")";
     if ($gameIds) {
         if (is_array($gameIds)) {
             $gameIds = implode(',', $gameIds);
         }
         $sql .= " and game_type in ({$gameIds})";
     }
     if ($operators) {
         if (is_array($operators)) {
             $operators = implode(',', $operators);
         }
         $sql .= " and operator_id in ({$operators})";
     }
     // 		echo "<p>".$sql;
     $dataList = $this->select($sql);
     if ($dataList) {
         $evArr = array();
         //1游戏BUG
         //2游戏设置不满意
         //3回复不清晰
         //4回复错误
         //5客服服务态度恶劣
         //6其他
         $evaluationDesc = array(1 => 32, 2 => 32, 3 => 3, 4 => 3, 5 => 3, 6 => 32, '' => 3);
         //32扩展为游戏差评、3保留为服务差评
         $workOrderList = array();
         foreach ($dataList as $list) {
             $workOrderList['total']['total']['total']++;
             //				$workOrderList['total']['total']['ev_'.$list['evaluation_status']]++;
             $workOrderList['total'][date('Y-m-d', $list['create_time'])]['total']++;
             //				$workOrderList['total'][date('Y-m-d',$list['create_time'])]['ev_'.$list['evaluation_status']]++;
             if ($list['is_verify'] && in_array($list['status'], array(3, 4))) {
                 $workOrderList['total']['total']['verify']++;
                 $workOrderList['total'][date('Y-m-d', $list['create_time'])]['verify']++;
                 $workOrderList[$list['owner_user_id']]['total']['verify']++;
                 $workOrderList[$list['owner_user_id']][date('Y-m-d', $list['create_time'])]['verify']++;
             }
             $workOrderList[$list['owner_user_id']]['total']['total']++;
             //				$workOrderList[$list['owner_user_id']]['total']['ev_'.$list['evaluation_status']]++;
             $workOrderList[$list['owner_user_id']][date('Y-m-d', $list['create_time'])]['total']++;
             //				$workOrderList[$list['owner_user_id']][date('Y-m-d',$list['create_time'])]['ev_'.$list['evaluation_status']]++;
             //对差评进行扩展
             if ($list['evaluation_status'] == 3) {
                 $tmpEv = $evaluationDesc[$list['evaluation_desc']];
                 $workOrderList['total']['total']['ev_' . $tmpEv]++;
                 $workOrderList[$list['owner_user_id']]['total']['ev_' . $tmpEv]++;
                 $workOrderList['total'][date('Y-m-d', $list['create_time'])]['ev_' . $tmpEv]++;
                 $workOrderList[$list['owner_user_id']][date('Y-m-d', $list['create_time'])]['ev_' . $tmpEv]++;
             } else {
                 $workOrderList['total']['total']['ev_' . $list['evaluation_status']]++;
                 $workOrderList[$list['owner_user_id']]['total']['ev_' . $list['evaluation_status']]++;
                 $workOrderList['total'][date('Y-m-d', $list['create_time'])]['ev_' . $list['evaluation_status']]++;
                 $workOrderList[$list['owner_user_id']][date('Y-m-d', $list['create_time'])]['ev_' . $list['evaluation_status']]++;
             }
         }
     }
     $allDay = Tools::getdateArr($date['start'], $date['end']);
     foreach ($users as $user) {
         foreach ($allDay as $key => $value) {
             if (!isset($workOrderList['total'][$key])) {
                 $workOrderList['total'][$key] = array();
             }
             if (!isset($workOrderList[$user][$key])) {
                 $workOrderList[$user][$key] = array();
             }
         }
         krsort($workOrderList[$user]);
     }
     krsort($workOrderList['total']);
     #------获取工单总数统计------#
     #------获取回复总记录数------#
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $sql = "select is_timeout,user_id,create_time from {$this->_modelWorkOrderQa->tName()} where create_time between {$date['start']} and {$date['end']} and qa=1 and user_id in (" . implode(',', $users) . ")";
     if ($gameIds) {
         $sql .= " and game_type_id in ({$gameIds})";
     }
     if ($operators) {
         if (is_array($operators)) {
             $operators = implode(',', $operators);
         }
         $sql .= " and operator_id in ({$operators})";
     }
     // 		echo "<p>".$sql;
     $dataList = $this->_modelWorkOrderQa->select($sql);
     if ($dataList) {
         $qaList = array();
         foreach ($dataList as $list) {
             $qaList['total']['total']['total_reply']++;
             $qaList['total']['total']['timeout_' . $list['is_timeout']]++;
             $qaList['total'][date('Y-m-d', $list['create_time'])]['total_reply']++;
             $qaList['total'][date('Y-m-d', $list['create_time'])]['timeout_' . $list['is_timeout']]++;
             $qaList[$list['user_id']]['total']['total_reply']++;
             $qaList[$list['user_id']]['total']['timeout_' . $list['is_timeout']]++;
             $qaList[$list['user_id']][date('Y-m-d', $list['create_time'])]['total_reply']++;
             $qaList[$list['user_id']][date('Y-m-d', $list['create_time'])]['timeout_' . $list['is_timeout']]++;
         }
     }
     $allDay = Tools::getdateArr($date['start'], $date['end']);
     foreach ($users as $user) {
         foreach ($allDay as $key => $value) {
             if (!isset($qaList['total'][$key])) {
                 $qaList['total'][$key] = array();
             }
             if (!isset($qaList[$user][$key])) {
                 $qaList[$user][$key] = array();
             }
         }
         krsort($qaList[$user]);
     }
     krsort($qaList['total']);
     #------获取回复总记录数------#
     #------质检统计------#
     $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object');
     $sql = "select quality_user_id,reply_user_id,scores,quality_time from {$this->_modelQuality->tName()} where quality_time between {$date['start']} and {$date['end']} and (quality_user_id in (" . implode(',', $users) . ") or reply_user_id in (" . implode(',', $users) . ")) ";
     if ($gameIds) {
         $sql .= " and game_type_id in ({$gameIds})";
     }
     if ($operators) {
         $sql .= " and operator_id in ({$operators})";
     }
     // 		echo "<p>".$sql;
     $dataList = $this->_modelQuality->select($sql);
     if ($dataList) {
         $qualityList = array();
         foreach ($dataList as $list) {
             $qualityList['total']['total']['total_quality']++;
             $qualityList['total'][date('Y-m-d', $list['quality_time'])]['total_quality']++;
             $qualityList['total']['total']['quality_num']++;
             $qualityList['total']['total']['reply_num']++;
             $qualityList['total'][date('Y-m-d', $list['quality_time'])]['quality_num']++;
             $qualityList['total'][date('Y-m-d', $list['quality_time'])]['reply_num']++;
             $qualityList[$list['quality_user_id']]['total']['quality_num']++;
             //质检回复量
             $qualityList[$list['quality_user_id']][date('Y-m-d', $list['quality_time'])]['quality_num']++;
             $qualityList[$list['reply_user_id']]['total']['reply_num']++;
             //被质检回复量
             $qualityList[$list['reply_user_id']][date('Y-m-d', $list['quality_time'])]['reply_num']++;
             if ($list['scores'] > 0) {
                 $qualityList['total']['total']['bonus_num']++;
                 $qualityList['total']['total']['bonus'] += $list['scores'];
                 $qualityList['total'][date('Y-m-d', $list['quality_time'])]['bonus_num']++;
                 $qualityList['total'][date('Y-m-d', $list['quality_time'])]['bonus'] += $list['scores'];
                 $qualityList[$list['reply_user_id']]['total']['bonus_num']++;
                 $qualityList[$list['reply_user_id']]['total']['bonus'] += $list['scores'];
                 $qualityList[$list['reply_user_id']][date('Y-m-d', $list['quality_time'])]['bonus_num']++;
                 $qualityList[$list['reply_user_id']][date('Y-m-d', $list['quality_time'])]['bonus'] += $list['scores'];
             } elseif ($list['scores'] < 0) {
                 $qualityList['total']['total']['deduction_num']++;
                 $qualityList['total']['total']['deduction'] += $list['scores'];
                 $qualityList['total'][date('Y-m-d', $list['quality_time'])]['deduction_num']++;
                 $qualityList['total'][date('Y-m-d', $list['quality_time'])]['deduction'] += $list['scores'];
                 $qualityList[$list['reply_user_id']]['total']['deduction_num']++;
                 $qualityList[$list['reply_user_id']]['total']['deduction'] += $list['scores'];
                 $qualityList[$list['reply_user_id']][date('Y-m-d', $list['quality_time'])]['deduction_num']++;
                 $qualityList[$list['reply_user_id']][date('Y-m-d', $list['quality_time'])]['deduction'] += $list['scores'];
             }
         }
     }
     $allDay = Tools::getdateArr($date['start'], $date['end']);
     foreach ($users as $user) {
         foreach ($allDay as $key => $value) {
             if (!isset($qualityList['total'][$key])) {
                 $qualityList['total'][$key] = array();
             }
             if (!isset($qualityList[$user][$key])) {
                 $qualityList[$user][$key] = array();
             }
         }
         krsort($qualityList[$user]);
     }
     krsort($qualityList['total']);
     #------质检统计------#
     #------BUGLIST------#
     $this->_modelVerify = $this->_getGlobalData('Model_Verify', 'object');
     $sql = "select user_id,finish_user_id,create_time from {$this->_modelVerify->tName()} where create_time between {$date['start']} and {$date['end']} and (user_id in (" . implode(',', $users) . ") or finish_user_id in (" . implode(',', $users) . "))";
     if ($gameIds) {
         $sql .= " and game_type_id in ({$gameIds})";
     }
     if ($operators) {
         $sql .= " and operator_id in ({$operators})";
     }
     // 		echo "<p>".$sql;
     $dataList = $this->_modelVerify->select($sql);
     if ($dataList) {
         $bugList = array();
         foreach ($dataList as $list) {
             $curTime = date('Y-m-d', $list['create_time']);
             $bugList['total']['total']['submit']++;
             $bugList['total'][$curTime]['submit']++;
             $bugList[$list['user_id']]['total']['submit']++;
             $bugList[$list['user_id']][$curTime]['submit']++;
             if ($list['finish_user_id']) {
                 $bugList['total']['total']['finish']++;
                 $bugList['total'][$curTime]['finish']++;
                 $bugList[$list['finish_user_id']]['total']['finish']++;
                 $bugList[$list['finish_user_id']][$curTime]['finish']++;
             }
         }
     }
     $allDay = Tools::getdateArr($date['start'], $date['end']);
     foreach ($users as $user) {
         foreach ($allDay as $key => $value) {
             if (!isset($bugList['total'][$key])) {
                 $bugList['total'][$key] = array();
             }
             if (!isset($bugList[$user][$key])) {
                 $bugList[$user][$key] = array();
             }
         }
         krsort($bugList[$user]);
     }
     krsort($bugList['total']);
     #------BUGLIST------#
     $arrayList = array();
     $arrayList['total'] = array_merge_recursive($workOrderList['total'], $qaList['total'], $qualityList['total'], $bugList['total']);
     foreach ($users as $user) {
         $arrayList[$user] = array_merge_recursive($workOrderList[$user], $qaList[$user], $qualityList[$user], $bugList[$user]);
     }
     return $arrayList;
 }
Exemplo n.º 6
0
 /**
  * 未发送致服务器的回复
  * @todo 新增动作
  */
 public function actionNotSendReply()
 {
     #------初始化------#
     $this->_loadCore('Help_Page');
     $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $qualityStatus = $this->_getGlobalData('quality_status');
     $qualityOptions = $this->_getGlobalData('quality_options');
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     #------初始化------#
     $selected = array();
     //模板默认值
     $users = $this->_getGlobalData('user');
     $helpSqlSearch->set_tableName($this->_modelWorkOrderQa->tName());
     $helpSqlSearch->set_conditions('qa=1');
     if ($_REQUEST['game_type_id']) {
         $helpSqlSearch->set_conditions("game_type_id={$_REQUEST['game_type_id']}");
         $selected['game_type_id'] = $_REQUEST['game_type_id'];
     }
     if ($_REQUEST['reply_user_id'] != '') {
         $helpSqlSearch->set_conditions("user_id={$_REQUEST['reply_user_id']}");
         $selected['reply_user_id'] = $_REQUEST['reply_user_id'];
     }
     if ($_REQUEST['start_time'] && $_REQUEST['end_time']) {
         $startTime = strtotime($_REQUEST['start_time']);
         $endTime = strtotime($_REQUEST['end_time']);
         $helpSqlSearch->set_conditions("create_time between {$startTime} and {$endTime}");
         $selected['start_time'] = $_REQUEST['start_time'];
         $selected['end_time'] = $_REQUEST['end_time'];
     }
     $helpSqlSearch->set_conditions('content like \'<em>%\' ');
     $helpSqlSearch->set_orderBy('create_time desc');
     $helpSqlSearch->setPageLimit($_GET['page']);
     $allConditions = $helpSqlSearch->get_conditions();
     //返回所有条件
     $helpPage = new Help_Page(array('total' => $this->_modelWorkOrderQa->findCount($allConditions), 'perpage' => PAGE_SIZE));
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelWorkOrderQa->select($sql);
     if ($dataList) {
         Tools::import('Util_FontColor');
         foreach ($dataList as &$value) {
             $value['word_game_type_id'] = $gameTypes[$value['game_type_id']];
             $value['word_is_quality'] = $value['is_quality'] ? $users[$value['is_quality']]['nick_name'] : '<font color="#666666">未质检</font>';
             $value['word_reply_name'] = $users[$value['user_id']]['nick_name'];
             $value['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
             $value['last_reply_time'] = date('Y-m-d H:i:s', $value['last_reply_time']);
             $value['url_detail'] = Tools::url('QualityCheck', 'Dialog', array('Id' => $value['work_order_id'], 'game_type_id' => $value['game_type_id'], 'operator_id' => $value['operator_id']));
             $value['content'] = strip_tags($value['content']);
         }
         $this->_view->assign('dataList', $dataList);
     }
     $gameTypes[''] = '所有';
     $this->_view->assign('gameTypes', $gameTypes);
     $this->_view->assign('users', $users);
     $this->_view->assign('selected', $selected);
     $this->_view->assign('pageBox', $helpPage->show());
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
Exemplo n.º 7
0
 /**
  * 回复列表
  */
 public function actionReplyIndex()
 {
     $selected = array();
     $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $timeOutArr = array(0 => Tools::getLang('NOT_TIMEOUT', 'Common'), 1 => Tools::getLang('TIMEOUT', 'Common'), '' => Tools::getLang('ALL', 'Common'));
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     $gameTypes[''] = Tools::getLang('ALL', 'Common');
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $operatorList[''] = Tools::getLang('ALL', 'Common');
     $userIndex = $this->_getGlobalData('user_index_id');
     $helpSqlSearch->set_tableName($this->_modelWorkOrderQa->tName());
     if ($_GET['game_type_id'] != '') {
         $_GET['game_type_id'] = Tools::coerceInt($_GET['game_type_id']);
         $helpSqlSearch->set_conditions("game_type_id={$_GET['game_type_id']}");
         $selected['game_type_id'] = $_GET['game_type_id'];
     }
     if ($_GET['operator_id'] != '') {
         $_GET['operator_id'] = Tools::coerceInt($_GET['operator_id']);
         $helpSqlSearch->set_conditions("operator_id={$_GET['operator_id']}");
         $selected['operator_id'] = $_GET['operator_id'];
     }
     if ($_GET['user_id']) {
         $_GET['user_id'] = Tools::coerceInt($_GET['user_id']);
         $helpSqlSearch->set_conditions("user_id={$_GET['user_id']}");
         $selected['user_id'] = $_GET['user_id'];
     } else {
         $helpSqlSearch->set_conditions("user_id!=0");
     }
     if ($_GET['start_time'] && $_GET['end_time']) {
         $selected['start_time'] = $_GET['start_time'];
         $selected['end_time'] = $_GET['end_time'];
         $helpSqlSearch->set_conditions("create_time between " . strtotime($_GET['start_time']) . " and " . strtotime($_GET['end_time']));
     }
     $helpSqlSearch->set_orderBy('create_time desc');
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     $conditions = $helpSqlSearch->get_conditions();
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelWorkOrderQa->select($sql);
     if ($dataList) {
         $this->_loadCore('Help_Page');
         $helpPage = new Help_Page(array('total' => $this->_modelWorkOrderQa->findCount($conditions), 'perpage' => PAGE_SIZE));
         $this->_view->assign('pageBox', $helpPage->show());
         foreach ($dataList as &$list) {
             $list['word_game_type_id'] = $gameTypes[$list['game_type_id']];
             $list['word_operator_id'] = $operatorList[$list['operator_id']];
             $list['word_time_out'] = $timeOutArr[$list['is_timeout']];
             $list['word_user_id'] = $userIndex[$list['user_id']];
             $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
             $list['url_detail'] = Tools::url(CONTROL, 'Detail', array('Id' => $list['work_order_id']));
         }
         $this->_view->assign('dataList', $dataList);
     }
     $this->_view->assign('selected', $selected);
     $this->_view->assign('gameTypes', $gameTypes);
     $this->_view->assign('operatorList', $operatorList);
     $this->_view->assign('timeOutArr', $timeOutArr);
     $this->_view->assign('users', $userIndex);
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }