/** * 添加服务器 */ private function _add() { if ($this->_isPost()) { if ($_POST['batch_add']) { $start = Tools::coerceInt($_POST['start']); $end = Tools::coerceInt($_POST['end']); $addArrs = array(); for ($i = $start; $i <= $end; $i++) { $addArrs[$i] = array('game_type_id' => intval($_POST['game_type']), 'operator_id' => intval($_POST['operator_id']), 'ordinal' => $i, 'server_name' => str_replace('{$var}', $i, $_POST['server_name']), 'marking' => str_replace('{$var}', $i, $_POST['marking']), 'server_url' => str_replace('{$var}', $i, $_POST['server_url']), 'timezone' => trim($_POST['timezone']), 'time_zone' => trim($_POST['time_zone']), 'timer' => intval($_POST['timer']), 'data_url' => str_replace('{$var}', $i, $_POST['data_url'])); } $reuslt = $this->_modelGameSerList->adds($addArrs); } else { $addArr = array('game_type_id' => intval($_POST['game_type']), 'operator_id' => intval($_POST['operator_id']), 'ordinal' => intval($_POST['ordinal']), 'server_name' => trim($_POST['server_name']), 'marking' => trim($_POST['marking']), 'server_url' => trim($_POST['server_url']), 'timezone' => trim($_POST['timezone']), 'time_zone' => trim($_POST['time_zone']), 'timer' => intval($_POST['timer']), 'data_url' => trim($_POST['data_url'])); $reuslt = $this->_modelGameSerList->add($addArr); } if ($reuslt) { $this->_utilMsg->showMsg(Tools::getLang('ADD_SUCCESS', 'Common'), 1, Tools::url(CONTROL, ACTION)); } else { $this->_utilMsg->showMsg(Tools::getLang('ADD_ERROR', 'Common'), -2); } } else { $gameTypeList = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name'); $operatorList = $this->_modelOperatorList->findAll(); $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name'); $this->_view->assign('operatorList', $operatorList); $this->_view->assign('gameTypeList', $gameTypeList); $timer = array('0' => '关闭', '1' => '开启'); $this->_view->assign('timer', $timer); $this->_utilMsg->createNavBar(); $this->_view->set_tpl(array('body' => 'GameSerList/Add.html')); $this->_view->display(); } }
/** * 添加服务器 */ private function _add() { if ($this->_isPost()) { $addArr = array('game_type_id' => $_POST['game_type'], 'operator_id' => $_POST['operator_id'], 'server_name' => $_POST['server_name'], 'marking' => $_POST['marking'], 'server_url' => $_POST['server_url'], 'send_msg_url' => $_POST['send_msg_url']); if ($this->_modelGameSerList->add($addArr)) { $this->_utilMsg->showMsg('添加成功', 1, Tools::url(CONTROL, ACTION)); } else { $this->_utilMsg->showMsg('添加失败', -2); } } else { $gameTypeList = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name'); $operatorList = $this->_modelOperatorList->findAll(); $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name'); $this->_view->assign('operatorList', $operatorList); $this->_view->assign('gameTypeList', $gameTypeList); $this->_utilMsg->createNavBar(); $this->_view->set_tpl(array('body' => 'GameSerList/Add.html')); $this->_view->display(); } }
/** * 察看详细 */ 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(); } }
private function _del() { $this->_modelOperatorList->deleteByIdAndServierList($_GET['Id']); $this->_utilMsg->showMsg(Tools::getLang('DEL_SUCCESS', 'Common'), 1); }
private function _del() { $this->_modelOperatorList->deleteByIdAndServierList($_GET['Id']); $this->_utilMsg->showMsg('删除运营商成功', 1); }