/** * 运营商按天数统计 */ public function actionOperatorDay() { $operatorList = $this->_getGlobalData('operator_list'); $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name'); $gameTypeList = $this->_getGlobalData('game_type'); $gameTypeList = Model::getTtwoArrConvertOneArr($gameTypeList, 'Id', 'name'); $this->_modelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object'); $gameOperatorIndex = $this->_modelGameOperator->findAll(); foreach ($gameOperatorIndex as &$value) { $value['word_operator_id'] = $operatorList[$value['operator_id']]; } if ($this->_isPost()) { if (empty($_POST['date'])) { $this->_utilMsg->showMsg('统计日期不能为空', -2); } if (empty($_POST['game_type_id']) || !count($_POST['operator_id'])) { $this->_utilMsg->showMsg('请选译游戏,和运营商', -2); } $curDate = $_POST['date']; $this->_view->assign('selectedGameTypeId', $_POST['game_type_id']); $selectedOperatorList = array(); foreach ($_POST['operator_id'] as $operatorId) { if (array_key_exists($operatorId, $operatorList)) { $selectedOperatorList[$operatorId] = $operatorList[$operatorId]; } } $this->_view->assign('selectedOperatorIds', $_POST['operator_id']); $this->_view->assign('selectedOperatorList', $selectedOperatorList); $this->_view->assign('selectedDate', $curDate); $date['start'] = strtotime($curDate); $date['end'] = $date['start'] + 24 * 60 * 60 - 1; $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object'); $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object'); $this->_modelReplyQulity = $this->_getGlobalData('Model_ReplyQulity', 'object'); $workOrderTotal = $this->_modelWorkOrder->getOperatorDayStatsNum($_POST['game_type_id'], $_POST['operator_id'], $date); $workOrderQaTotal = $this->_modelWorkOrderQa->getOperatorDayStatsNum($_POST['game_type_id'], $_POST['operator_id'], $date); $replyQulityTotal = $this->_modelReplyQulity->getOperatorDayStatsNum($_POST['game_type_id'], $_POST['operator_id'], $date); if (is_array($workOrderQaTotal) && is_array($replyQulityTotal) && is_array($workOrderTotal)) { $total = array(); for ($i = 0; $i <= 23; $i++) { if (!$workOrderQaTotal[$i]) { $workOrderQaTotal[$i] = array(); } if (!$replyQulityTotal[$i]) { $replyQulityTotal[$i] = array(); } if (!$workOrderTotal[$i]) { $workOrderTotal[$i] = array(); } $total[$i] = array_merge($workOrderQaTotal[$i], $replyQulityTotal[$i], $workOrderTotal[$i]); } if (!$workOrderQaTotal['total']) { $workOrderQaTotal['total'] = array(); } if (!$replyQulityTotal['total']) { $replyQulityTotal['total'] = array(); } if (!$workOrderTotal['total']) { $workOrderTotal['total'] = array(); } $total['total'] = array_merge($workOrderQaTotal['total'], $replyQulityTotal['total'], $workOrderTotal['total']); } $this->_view->assign('total', $total); $this->_view->assign('displayTrue', true); } $this->_view->assign('js', $this->_view->get_curJs()); $this->_view->assign('gameOperatorIndex', json_encode($gameOperatorIndex)); $this->_view->assign('gameTypeList', $gameTypeList); $this->_utilMsg->createNavBar(); $this->_view->display(); }