Ejemplo n.º 1
0
 private function _edit()
 {
     if ($this->_isPost()) {
         if ($this->_modelOperatorList->update(array('operator_name' => $_POST['operator_name']), "Id={$_POST['Id']}")) {
             $this->_modelOperatorList->createToCache();
             $this->_utilMsg->showMsg(Tools::getLang('EDIT_SUCCESS', 'Common'), 1, Tools::url(CONTROL, ACTION));
         } else {
             $this->_utilMsg->showMsg(Tools::getLang('EDIT_ERROR', 'Common'), -2);
         }
     } else {
         $this->_utilMsg->createNavBar();
         $data = $this->_modelOperatorList->findById($_GET['Id'], false);
         $this->_view->assign('id', $_GET['Id']);
         $this->_view->assign('data', $data);
         $this->_view->set_tpl(array('body' => 'GameOperator/Edit.html'));
         $this->_view->display();
     }
 }
Ejemplo n.º 2
0
 /**
  * 察看详细
  */
 public function actionQualityDetail()
 {
     #------初始化------#
     $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object');
     #------初始化------#
     if ($this->_isPost()) {
         switch ($_POST['submit_type']) {
             case '0':
                 //质检
                 $this->_utilMsg->showMsg(false);
                 break;
             case '1':
                 //申诉
                 if ($this->_modelQuality->update(array('status' => $_POST['status'], 'complain_content' => $_POST['complain_content'], 'complain_time' => CURRENT_TIME), "Id={$_POST['Id']}")) {
                     $this->_utilMsg->showMsg(false);
                 } else {
                     $this->_utilMsg->showMsg('申请失败', -2);
                 }
                 break;
             default:
                 //默认回复申诉
                 $updateArr = array('status' => $_POST['status'], 'reply_content' => $_POST['reply_content'], 'reply_time' => CURRENT_TIME);
                 if ($_POST['status'] == 3) {
                     $updateArr['scores'] = '0';
                 }
                 //如果申诉为同意申诉,将把扣分设置为0,不扣分;
                 if ($this->_modelQuality->update($updateArr, "Id={$_POST['Id']}")) {
                     $this->_utilMsg->showMsg(false);
                 } else {
                     $this->_utilMsg->showMsg('回复申诉失败', -2);
                 }
                 break;
         }
     } else {
         #------初始化------#
         $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
         $this->_modelSysconfig = $this->_getGlobalData('Model_Sysconfig', 'object');
         $this->_modelGameSerList = $this->_getGlobalData('Model_GameSerList', 'object');
         $this->_modelOperatorList = $this->_getGlobalData('Model_OperatorList', 'object');
         $this->_modelQuestionType = $this->_getGlobalData('Model_QuestionType', 'object');
         $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
         $user = $this->_getGlobalData('user');
         $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
         #------初始化------#
         #------质检详细------#
         $qualityOptions = $this->_getGlobalData('quality_options');
         $qualityList = $this->_modelQuality->findByQaId($_GET['qa_id']);
         $qualityList['word_option_id'] = $qualityOptions[$qualityList['option_id']];
         $qualityList['word_status'] = $this->_statusOptions[$qualityList['status']];
         $qualityList['word_quality_user_id'] = $user[$qualityList['quality_user_id']]['full_name'];
         $qualityList['word_again_user_id'] = $user[$qualityList['again_user_id']]['full_name'];
         $qualityList['reply_time'] = $qualityList['reply_time'] ? date('Y-m-d H:i:s', $qualityList['reply_time']) : '';
         $qualityList['quality_time'] = $qualityList['quality_time'] ? date('Y-m-d H:i:s', $qualityList['quality_time']) : '';
         $qualityList['complain_time'] = $qualityList['complain_time'] ? date('Y-m-d H:i:s', $qualityList['complain_time']) : '';
         $qualityList['again_time'] = $qualityList['again_time'] ? date('Y-m-d H:i:s', $qualityList['again_time']) : '';
         #------质检详细------#
         $dataList = $this->_modelWorkOrder->findByIdDetail($_GET['work_order_id']);
         //获取工单整个数组,包括关联表
         if (!$dataList) {
             $this->_utilMsg->showMsg('内容错误,请联系管理员', -2);
         }
         //防止错误
         $dialogArr = $dataList;
         //客服与用户的对话数组
         $dataList = $dataList[0];
         //列表详细
         #------载入缓存------#
         $gameTypeArr = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
         //游戏类型
         $workOrderSourceArr = $this->_modelSysconfig->getValueToCache('workorder_source');
         //工单来源
         $workOrderStatusArr = $this->_modelSysconfig->getValueToCache('workorder_status');
         //工单状态
         $gameSerList = $this->_modelGameSerList->findById($dataList['game_server_id']);
         $operatorList = $this->_modelOperatorList->findById($dataList['operator_id']);
         #------载入缓存------#
         $user = Model::getTtwoArrConvertOneArr($user, 'user_name', 'full_name');
         foreach ($dialogArr as &$list) {
             $list['qa_time'] = date('Y-m-d H:i:s', $list['qa_time']);
             $list['word_reply_name'] = $user[$list['reply_name']];
         }
         $workOrderDetailArr = unserialize($dataList['detail']);
         //获取工单的详细信息
         $userData = $workOrderDetailArr['user_data'];
         //获取提交工单用户的详细信息
         $userData['register_date'] = date('Y-m-d H:i:s', $userData['register_date']);
         $userQuestionDetail = $workOrderDetailArr['form_detail'];
         //获取提问类型工单的值
         $questionDetail = $this->_modelQuestionType->findById($dataList['question_type']);
         //查找问题类型
         #------跟椐ID转换文字显示------#
         $dataList['word_question_type'] = $questionDetail['title'];
         //获取问题类型的中文名称以方便显示
         $dataList['word_game_type'] = $gameTypeArr[$dataList['game_type']];
         $dataList['word_source'] = $workOrderSourceArr[$dataList['source']];
         $dataList['word_status'] = $workOrderStatusArr[$dataList['status']];
         $dataList['word_game_server_id'] = $gameSerList['server_name'];
         $dataList['word_operator_id'] = $operatorList['operator_name'];
         $dataList['create_time'] = date('Y-m-d H:i', $dataList['create_time']);
         $dataList['word_quality_id'] = $user[$dataList['quality_id']]['full_name'];
         #------跟椐ID转换文字显示------#
         $questionDetail = $questionDetail['form_table'];
         //获取问题类型的表单配置值
         $userQuestionDetailArr = array();
         //初始化显示提交问题类型数组
         if (count($questionDetail)) {
             foreach ($questionDetail as $value) {
                 //将表单转换为key/value方式,方便显示
                 if ($value['type'] == 'game_server_list') {
                     continue;
                 }
                 //如果为服务器列表将跳过,因为已经在工单上面有了.
                 switch ($value['type']) {
                     case 'select':
                         $userQuestionDetailArr[$value['title']] = $value['options'][$userQuestionDetail[$value['name']]];
                         break;
                     default:
                         $userQuestionDetailArr[$value['title']] = $userQuestionDetail[$value['name']];
                         break;
                 }
             }
         }
         $this->_view->assign('qualityList', $qualityList);
         $this->_view->assign('workOrderStatusArr', $workOrderStatusArr);
         $this->_view->assign('userData', $userData);
         $this->_view->assign('userQuestionDetailArr', $userQuestionDetailArr);
         //问题类型显示
         $this->_view->assign('dialogArr', $dialogArr);
         //对话详细
         $this->_view->assign('data', $dataList);
         //表单详细信息
         $this->_view->assign('userClass', $this->_utilRbac->getUserClass());
         $this->_utilMsg->createNavBar();
         $this->_view->display();
     }
 }