Пример #1
0
 /**
  * 重置工作量
  */
 private function _rest()
 {
     $roomId = Tools::coerceInt($_GET['Id']);
     //需要重置工作量的房间ID
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $data = $this->_modelWorkOrder->clearRoomOrder($roomId);
     $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']);
 }
Пример #2
0
 /**
  * 清空质检任务
  */
 public function actionClearQualityCheck()
 {
     $userId = Tools::coerceInt($_GET['user_id']);
     //用户名
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $data = $this->_modelWorkOrder->clearTask($userId);
     $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']);
 }
Пример #3
0
 /**
  * 更新拥有者
  */
 public function updateWorkOrderOwner(Object_UserInfo $userClass, $workOrder)
 {
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $this->_modelWorkOrder->update(array('owner_user_id' => $userClass['_id']), "Id={$workOrder['work_order_id']}");
     $userClass->addToOrderNum(1);
     //增加自身的工单数量
     $userClass->setUpdateInfo(1);
 }
Пример #4
0
 /**
  * 添加问题
  */
 public function actionAdd()
 {
     if ($this->_isPost()) {
         $this->_modelWorkOrderDetail = $this->_getGlobalData('Model_WorkOrderDetail', 'object');
         $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
         #------获取问题类型额外信息------#
         $questionType = $this->_modelQuestionType->findById($_POST['question_type']);
         $questionFormTable = $questionType['form_table'];
         $questionFormTableKey = $this->_modelQuestionType->getTtwoArrConvertOneArr($questionFormTable, 'name', 'name');
         $formDetail = array();
         if (!empty($questionFormTableKey)) {
             foreach ($questionFormTableKey as $value) {
                 if ($value == null) {
                     continue;
                 }
                 $formDetail[$value] = $_POST[$value];
             }
         }
         #------获取问题类型额外信息------#
         #------生成工单work_order------#
         $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
         $userClass = $this->_utilRbac->getUserClass();
         //获取用户资料,
         $userName = $userClass['_nickName'];
         $workOrder = array('game_type' => $_POST['game_type'], 'question_type' => $_POST['question_type'], 'source' => 5, 'question_num' => 1, 'create_time' => CURRENT_TIME, 'title' => $_POST['title']);
         if ($_POST['game_server_id']) {
             #------获取服务器ID和运营商ID------#
             list($workOrder['operator_id'], $workOrder['game_server_id']) = explode(',', $_POST['game_server_id']);
             unset($formDetail['game_server_id']);
             //删除服务器列表数组
             #------获取服务器ID和运营商ID------#
         }
         $this->_modelWorkOrder->add($workOrder);
         $workOrderId = $this->_modelWorkOrder->returnLastInsertId();
         //获取工单id
         #------生成工单work_order------#
         #------生成工单详细信息------#
         $userDetail = array('nick_name' => $userName);
         $detail = array('user_data' => $userDetail, 'form_detail' => $formDetail);
         $addWorkOrderDetailArr = array('work_order_id' => $workOrderId, 'content' => serialize($detail));
         $this->_modelWorkOrderDetail->add($addWorkOrderDetailArr);
         #------生成工单详细信息------#
         #------生成工单提问信息------#
         $addWorkOrderQaArr = array('work_order_id' => $workOrderId, 'content' => $_POST['description'], 'create_time' => CURRENT_TIME);
         $this->_modelWorkOrderQa->add($addWorkOrderQaArr);
         #------生成工单提问回复信息------#
         #------增加问题队列到队列------#
         $this->_utilWorkOrder = $this->_getGlobalData('Util_WorkOrder', 'object');
         $orderManage = $this->_utilWorkOrder->getOrderManage();
         $workOrder['Id'] = $workOrderId;
         $orderManage->addOrder($workOrder);
         $orderManage->setUpdateInfo(1);
         #------增加问题队列到队列------#
         $this->_utilMsg->showMsg('工单提问成功', 1, Tools::url(CONTROL, 'Index', 1));
     }
 }
Пример #5
0
 /**
  * 数据统计 
  */
 public function actionData()
 {
     // 		ini_set("display_errors", "On");
     // 		error_reporting(E_ALL | E_STRICT);
     $this->_modelUser = $this->_getGlobalData('Model_User', 'object');
     $orgList = $this->_getGlobalData('org');
     $allOrgUser = $this->_modelUser->findSetOrgByUser();
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     $this->_view->assign('game_type', $gameTypes);
     $utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $operators = $utilRbac->getOperatorActList();
     //个人授权可操作的运营商
     $this->_view->assign('operators', $operators);
     foreach ($orgList as &$value) {
         $curOrgUser = $this->_modelUser->findByOrgId($value['Id']);
         if ($curOrgUser) {
             $curOrgUser = Model::getTtwoArrConvertOneArr($curOrgUser, 'Id', 'nick_name');
             $value['user'] = $curOrgUser;
         }
     }
     $this->_view->assign('orgList', $orgList);
     if ($this->_isPost()) {
         @ini_set('memory_limit', '512M');
         if (count($_POST['check_users']) && $_POST['start_date'] && $_POST['end_date'] && count($_POST['operator_id'])) {
             //必须保证有搜索项而且还选择了用户才会开开始搜索
             $date = array();
             $this->_view->assign('selectedTime', array('start' => $_POST['start_date'], 'end' => $_POST['end_date']));
             $this->_view->assign('selectedUsers', $_POST['check_users']);
             $date['start'] = strtotime($_POST['start_date']);
             //开始时间
             $date['end'] = strtotime($_POST['end_date']);
             //结束时间
             if ($date['start'] > $date['end']) {
                 $this->_utilMsg->showMsg('开始时间不能大于结束时间', -2);
             }
             $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
             $statusList = $this->_modelWorkOrder->statsDetail(array('start' => strtotime($_POST['start_date']), 'end' => strtotime($_POST['end_date'])), $_POST['check_users'], $_POST['game_type'], $_POST['operator_id']);
             $this->_view->assign('dataList', $statusList);
             $this->_view->assign('users', $this->_getGlobalData('user_index_id'));
         } else {
             $this->_utilMsg->showMsg('请选择时间,用户,运营商', -2);
         }
     }
     $this->_utilMsg->createPackageNavBar();
     if ($_POST['xls']) {
         Tools::import('Util_ExportExcel');
         $this->_utilExportExcel = new Util_ExportExcel('用户详细统计', 'Excel/StatsUser', $statusList);
         $this->_utilExportExcel->outPutExcel();
     } else {
         $this->_view->display();
     }
 }
Пример #6
0
 /**
  * 更改状态
  */
 public function actionChangeStatus()
 {
     if ($this->_isAjax()) {
         $id = Tools::coerceInt($_GET['Id']);
         $status = Tools::coerceInt($_GET['status']);
         if ($this->_modelWorkOrder->update(array('status' => $status), "Id={$id}")) {
             $this->_returnAjaxJson(array('status' => 1, 'msg' => '更改状态成功'));
         } else {
             $this->_returnAjaxJson(array('status' => 0, 'msg' => '更改状态失败'));
         }
     }
 }
Пример #7
0
 /**
  * 满意度统计
  * @author xy
  */
 public function actionSatisfaction()
 {
     $ModelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object');
     $gameOperator = $ModelGameOperator->getGameOperator(true);
     //游戏与运营商对应的数组
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     //游戏类型
     $vipIndex = Tools::getLang('VIP_LEVEL', 'Common');
     $this->_modelRooms = $this->_getGlobalData('Model_Rooms', 'object');
     $roomList = $this->_modelRooms->findAll();
     $roomList = Model::getTtwoArrConvertOneArr($roomList, 'Id', 'name');
     //$roomList['']=Tools::getLang('All','Common');
     array_pop($vipIndex);
     //弹出最后一个
     if ($this->_isPost()) {
         // 			print_r($_POST);exit;
         $selected = array();
         if (!$_POST['game_operator_id'] && !$_POST['game_type_id']) {
             $this->_utilMsg->showMsg('请至少选择一个运营商或游戏', -1);
         }
         if (!$_POST['start_time'] || !$_POST['end_time']) {
             $this->_utilMsg->showMsg('请指定时间范围', -1);
         }
         $selected['roomList'] = $_POST['roomList'];
         $selected['game_type_id'] = $_POST['game_type_id'];
         $selected['game_operator_id'] = $_POST['game_operator_id'] ? json_encode($_POST['game_operator_id']) : '""';
         $selected['start_time'] = $_POST['start_time'];
         $selected['end_time'] = $_POST['end_time'];
         $selected['vip_level'] = $_POST['vip_level'];
         $this->_view->assign('selected', $selected);
         $time = array('start_time' => strtotime($_POST['start_time']), 'end_time' => strtotime($_POST['end_time']) + 86399);
         $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
         $dataList = $this->_modelWorkOrder->statsSatisfaction($time, $_POST['game_type_id'], $_POST['game_operator_id'], $_POST['vip_level'], $_POST['roomList']);
         //返回的数组中,第一个元素是游戏数组,第二个元素是
         // 			$gmIdOptId = $ModelGameOperator ->getGmIdOptId($_POST['game_operator_id']);
         // 			if(!$_POST['game_operator_id']){
         // 				$gmIdOptId['gameIds'] = $_POST['game_type_id'];
         // 				$gmIdOptId['opreatorIds'] = array();
         // 			}
         // 			$dataList=$this->_modelWorkOrder->statsSatisfaction($time,$gmIdOptId['gameIds'],$gmIdOptId['opreatorIds'],$_POST['vip_level'],$_POST['roomList']);
         $this->_view->assign('dataList', $dataList);
         $this->_view->assign('display', true);
     }
     $this->_view->assign('roomList', $roomList);
     $this->_view->assign('gameTypes', $gameTypes);
     $this->_view->assign('gameOperator', json_encode($gameOperator));
     $this->_view->assign('vipIndex', $vipIndex);
     $this->_utilMsg->createPackageNavBar();
     // 		print_r($gameOperator);exit;
     $this->_view->display();
 }
Пример #8
0
 public function actionChangetheStatus()
 {
     if ($this->_isPost()) {
         foreach ($_POST['ids'] as $_msg) {
             if (!$this->_modelWorkOrder->ChangeStatus($_msg, $_POST['status'])) {
                 $error .= "{id:" . $_msg . "}";
             }
         }
         if (empty($error)) {
             $this->_utilMsg->showMsg($error, -1);
         } else {
             $this->_utilMsg->showMsg('操作成功', 1);
         }
     }
 }
Пример #9
0
 private function _documentAdd()
 {
     if ($this->_isPost()) {
         $this->_modelQualityDocument = $this->_getGlobalData('Model_QualityDocument', 'object');
         $data = $this->_modelQualityDocument->add($_POST);
         $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']);
     } else {
         $orgList = Model::getTtwoArrConvertOneArr($this->_getGlobalData('org'), 'Id', 'name');
         //组列表
         $users = Model::getTtwoArrConvertOneArr($this->_getGlobalData('user'), 'Id', 'nick_name');
         //用户列表
         $source = $this->_getGlobalData('verify_source');
         //来源
         $socres = Tools::getLang('QUALITY_SOURCE', 'Common');
         //分数
         $feedBack = array('1' => '是', '0' => '否');
         $verifyStatus = $this->_getGlobalData('verify_status');
         if ($_GET['Id']) {
             $workOrderId = Tools::coerceInt($_GET['work_order_id']);
             $qaId = Tools::coerceInt($_GET['qa_id']);
             $id = Tools::coerceInt($_GET['Id']);
             $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
             $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
             $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object');
             $qualityDetail = $this->_modelQuality->findById($id);
             $userClass = $this->_utilRbac->getUserClassById($qualityDetail['reply_user_id']);
             $workOrderDetail = $this->_modelWorkOrder->findById($workOrderId);
             $selected = array();
             $selected['title'] = $workOrderDetail['title'];
             $selected['source'] = $workOrderDetail['source'];
             $selected['org_id'] = $userClass['_orgId'];
             $selected['reply_user_id'] = $qualityDetail['reply_user_id'];
             $selected['quality_user_id'] = $qualityDetail['quality_user_id'];
             $selected['option_id'] = $qualityDetail['option_id'];
             $selected['scores'] = $qualityDetail['scores'];
             $this->_view->assign('selected', $selected);
         }
         $this->_view->assign('verifyStatus', $verifyStatus);
         $this->_view->assign('orgList', $orgList);
         $this->_view->assign('users', $users);
         $this->_view->assign('source', $source);
         $this->_view->assign('socres', $socres);
         $this->_view->assign('feedBack', $feedBack);
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'QualityCheck/DocumentAdd.html'));
         $this->_view->display();
     }
 }
Пример #10
0
 /**
  * 删除工单
  */
 public function actionDel()
 {
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $workOrderId = $_REQUEST['id'];
     if (is_array($workOrderId)) {
         //判断单个删除或是多个删除
         $workOrderId = implode(',', $workOrderId);
         $isOk = $this->_modelWorkOrder->update(array('status' => 4), "Id in ({$workOrderId})");
     } else {
         $workOrderId = Tools::coerceInt($workOrderId);
         $isOk = $this->_modelWorkOrder->update(array('status' => 4), "Id={$workOrderId}");
     }
     if ($isOk) {
         //是否删除成功
         $this->_returnAjaxJson(array('status' => 1, 'info' => null, 'data' => null));
     } else {
         $this->_returnAjaxJson(array('status' => 0, 'info' => null, 'data' => null));
     }
 }
Пример #11
0
 /**
  * 用户计算器
  * @param $expire 默认180秒
  */
 public function userCount($expire = 180)
 {
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $userClass = $this->_utilRbac->getUserClass();
     if (!is_object($userClass)) {
         return;
     }
     $isTimeOut = $this->get(COUNT_USER . $userClass['_id']);
     if (!$isTimeOut) {
         $gameTypes = $userClass->getUserGameTypeIds();
         $operatorIds = $userClass->getUserOperatorIds();
         if (!count($gameTypes) || !count($operatorIds)) {
             return;
         }
         //如果没有负责的游戏或是负责的运营商,就退出
         $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
         $count = $this->_modelWorkOrder->select("select count(Id) as count from {$this->_modelWorkOrder->tName()} where game_type in (" . implode(',', $gameTypes) . ") and operator_id in (" . implode(',', $operatorIds) . ") and owner_user_id = {$userClass['_id']} and status=1", 1);
         $count = $count['count'];
         $this->set(COUNT_USER . $userClass['_id'], true, $expire);
         $userClass->setupIncomplete($count);
         $userClass->setUpdateInfo(1);
     }
 }
Пример #12
0
 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));
 }
Пример #13
0
 public function actionIndex()
 {
     #------初始化------#
     $this->_loadCore('Help_Page');
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $this->_modelSysconfig = $this->_getGlobalData('Model_Sysconfig', 'object');
     $this->_modelQuestionType = $this->_getGlobalData('Model_QuestionType', 'object');
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $this->_utilRooms = $this->_getGlobalData('Util_Rooms', 'object');
     $this->_utilOnline = $this->_getGlobalData('Util_Online', 'object');
     $workOrderStatusArr = $this->_modelSysconfig->getValueToCache('workorder_status');
     $gameTypeArr = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     #------初始化------#
     $userClass = $this->_utilRbac->getUserClass();
     $roomId = $userClass['_roomId'];
     if ($roomId) {
         //			$this->_utilMsg->showMsg('请先加入房间',-1,Tools::url('Group','Index'));
         $roomClass = $this->_utilRooms->getRoom($roomId);
         $this->_view->assign('roomClass', $roomClass);
     }
     $userGameTypes = $userClass->getUserGameTypeIds();
     //获取用户能控制的游戏ids
     $userOperatorIds = $userClass->getUserOperatorIds();
     //获取用户能控制的运营商ids
     if (!count($userGameTypes) && !count($userOperatorIds)) {
         $this->_utilMsg->showMsg('请先设置用户运营商权限', -1, Tools::url('Group', 'Room'));
     }
     //如果用户没有权限将退出
     $onlineUsers = $this->_utilOnline->getOnlineUser('user_id');
     //在线用户,一维数组,value值为user_id
     #------分页生成sql------#
     $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName());
     //		$helpSqlSearch->set_conditions("room_id={$roomId}");	//只显示房间内的
     if ($_GET['Id']) {
         $helpSqlSearch->set_conditions("Id={$_GET['Id']}");
         $this->_view->assign('selectedId', $_GET['Id']);
     }
     if ($_GET['vip_level'] != '') {
         //如果设置了vip等级,将显示等级
         $helpSqlSearch->set_conditions("vip_level={$_GET['vip_level']}");
         $this->_view->assign('selectedVipLevel', $_GET['vip_level']);
     }
     if ($_GET['order_status']) {
         $helpSqlSearch->set_conditions("status={$_GET['order_status']}");
         $this->_view->assign('selectedOrderStatus', $_GET['order_status']);
         $helpSqlSearch->set_orderBy('create_time desc');
     } else {
         $helpSqlSearch->set_orderBy('status asc,create_time desc');
     }
     $helpSqlSearch->set_conditions("owner_user_id={$userClass['_id']}");
     if ($_GET['user_nickname']) {
         $helpSqlSearch->set_conditions("user_nickname='{$_GET['user_nickname']}'");
         $this->_view->assign('selectedUserNickname', $_GET['user_nickname']);
         $_GET['user_nickname'] = urlencode($_GET['user_nickname']);
     }
     if ($_GET['user_account']) {
         $helpSqlSearch->set_conditions("user_account='{$_GET['user_account']}'");
         $this->_view->assign('selectedUserAccount', $_GET['user_account']);
         $_GET['user_account'] = urlencode($_GET['user_account']);
     }
     if ($_GET['title']) {
         $helpSqlSearch->set_conditions("title like '%{$_GET['title']}%'");
         $this->_view->assign('selectedTitle', $_GET['title']);
         $_GET['title'] = urlencode($_GET['title']);
     }
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     $sql = $helpSqlSearch->createSql();
     $conditions = $helpSqlSearch->get_conditions();
     $helpPage = new Help_Page(array('total' => $this->_modelWorkOrder->findCount($conditions), 'perpage' => PAGE_SIZE));
     #------分页生成sql------#
     $dataList = $this->_modelWorkOrder->select($sql);
     #------载入缓存------#
     $workOrderSourceArr = $this->_modelSysconfig->getValueToCache('workorder_source');
     $vipLevel = array('0' => '普通', '1' => '一级', '2' => '二级', '3' => '三级', '4' => '四级', '5' => '五级', '6' => '六级', '' => '所有');
     $users = $this->_getGlobalData('user');
     $serverList = $this->_getGlobalData('gameser_list');
     $serverList = Model::getTtwoArrConvertOneArr($serverList, 'Id', 'server_name');
     #------载入缓存------#
     if ($dataList) {
         Tools::import('Util_FontColor');
         foreach ($dataList as &$list) {
             $list['url_dialog'] = Tools::url(CONTROL, 'OrderDialog', array('Id' => $list['Id']));
             $list['word_game_type'] = Util_FontColor::getGameTypeColor($list['game_type'], $gameTypeArr[$list['game_type']]);
             $list['word_source'] = Util_FontColor::getWorkOrderSource($list['source'], $workOrderSourceArr[$list['source']]);
             $list['word_status'] = Util_FontColor::getWorkOrderStatus($list['status'], $workOrderStatusArr[$list['status']]);
             $list['word_operator_id'] = $operatorList[$list['operator_id']];
             $questionArr = $this->_modelQuestionType->findById($list['question_type']);
             $list['word_question_type'] = $questionArr['title'] ? $questionArr['title'] : '游戏提问';
             $list['url_detail'] = Tools::url('WorkOrder', 'Detail', array('Id' => $list['Id']));
             $list['word_owner_user_id'] = $users[$list['owner_user_id']]['nick_name'];
             $list['word_game_server_id'] = $serverList[$list['game_server_id']];
             if ($list['status'] == 1) {
                 $isTimeout = Tools::isTimeOut($list['create_time'], $list['timeout']);
                 if ($isTimeout === true) {
                     //已超时
                     $list['time_out_true'] = true;
                 } else {
                     //未超时
                     $list['lost_time'] = Tools::getTimeFormat($isTimeout);
                 }
             }
             $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
             if ($list['word_owner_user_id']) {
                 $list['word_owner_user_id'] .= in_array($list['owner_user_id'], $onlineUsers) ? Util_FontColor::getOnline(1) : Util_FontColor::getOnline(0);
             }
         }
         $this->_view->assign('dataList', $dataList);
     }
     $userOperator = $userClass['_operatorIds'];
     foreach ($userOperator as &$value) {
         $value['word_operator_id'] = $operatorList[$value['operator_id']];
         $value['word_game_type_id'] = $gameTypeArr[$value['game_type_id']];
     }
     $this->_view->assign('userClass', $userClass);
     $this->_view->assign('userOperator', $userOperator);
     $this->_view->assign('vipLevel', $vipLevel);
     $workOrderStatusArr[''] = '所有';
     $this->_view->assign('workOrderStatusArr', $workOrderStatusArr);
     $this->_view->assign('js', $this->_view->get_curJs());
     $this->_view->assign('pageBox', $helpPage->show());
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
Пример #14
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);
     }
 }
Пример #15
0
 private function _ref()
 {
     #------初始化------#
     if (!$this->_isAjax()) {
         return;
     }
     parse_str($_POST['url'], $_GET);
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $this->_modelSysconfig = $this->_getGlobalData('Model_Sysconfig', 'object');
     $this->_modelQuestionType = $this->_getGlobalData('Model_QuestionType', 'object');
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $this->_utilRooms = $this->_getGlobalData('Util_Rooms', 'object');
     $this->_utilOnline = $this->_getGlobalData('Util_Online', 'object');
     $workOrderStatusArr = $this->_modelSysconfig->getValueToCache('workorder_status');
     $gameTypeArr = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $evArr = $this->_modelWorkOrder->getEvArr();
     //获取评价数组
     $badEvArr = $this->_getGlobalData('player_evaluation');
     $badEvArr = $badEvArr[3]['Description'];
     //差评数组
     #------初始化------#
     $userClass = $this->_utilRbac->getUserClass();
     $userGameTypes = $userClass->getUserGameTypeIds();
     //获取用户能控制的游戏ids
     $userOperatorIds = $userClass->getUserOperatorIds();
     //获取用户能控制的运营商ids
     $questionTypes = $this->_getGlobalData('question_types');
     $questionTypes = Model::getTtwoArrConvertOneArr($questionTypes, 'Id', 'title');
     $onlineUsers = $this->_utilOnline->getOnlineUser('user_id');
     //在线用户,一维数组,value值为user_id
     #------分页生成sql------#
     $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName());
     if (!$_GET['view_type']) {
         $_GET['view_type'] = 1;
     }
     if ($_GET['view_type'] == 1) {
         $helpSqlSearch->set_conditions("owner_user_id={$userClass['_id']}");
     } else {
         if (count($userGameTypes) == 1) {
             $gameTypeId = reset($userGameTypes);
             $helpSqlSearch->set_conditions("game_type = {$gameTypeId}");
             //只能处理的所有工单
         } else {
             $helpSqlSearch->set_conditions("game_type in (" . implode(',', $userGameTypes) . ")");
             //只能处理的所有工单
         }
         if (count($userOperatorIds) == 1) {
             $operatorId = reset($userOperatorIds);
             $helpSqlSearch->set_conditions("operator_id = {$operatorId}");
         } else {
             $helpSqlSearch->set_conditions("operator_id in (" . implode(',', $userOperatorIds) . ")");
         }
     }
     if ($_GET['question_type']) {
         $helpSqlSearch->set_conditions("question_type={$_GET['question_type']}");
     }
     if ($_GET['vip_level'] != '') {
         $helpSqlSearch->set_conditions("vip_level={$_GET['vip_level']}");
     }
     if ($_GET['evaluation_status'] != '') {
         $helpSqlSearch->set_conditions("evaluation_status={$_GET['evaluation_status']}");
         if ($_GET['evaluation_status'] == 3) {
             //如果为差评
             $this->_view->assign('badev_display', true);
         }
     }
     if ($_GET['evaluation_desc'] != '') {
         $helpSqlSearch->set_conditions("evaluation_desc={$_GET['evaluation_desc']}");
     }
     if ($_GET['order_status']) {
         $helpSqlSearch->set_conditions("status={$_GET['order_status']}");
         $helpSqlSearch->set_orderBy('`create_time` desc');
     } else {
         $helpSqlSearch->set_orderBy('`status` asc,`create_time` desc');
     }
     if ($_GET['user_nickname']) {
         $helpSqlSearch->set_conditions("user_nickname='{$_GET['user_nickname']}'");
     }
     if ($_GET['user_account']) {
         $helpSqlSearch->set_conditions("user_account='{$_GET['user_account']}'");
     }
     if ($_GET['title']) {
         $helpSqlSearch->set_conditions("title like '%{$_GET['title']}%'");
     }
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelWorkOrder->select($sql);
     #------分页生成sql------#
     #------载入缓存------#
     $workOrderSourceArr = $this->_modelSysconfig->getValueToCache('workorder_source');
     $vipLevel = Tools::getLang('VIP_LEVEL', 'Common');
     $users = $this->_getGlobalData('user');
     $serverList = $this->_getGlobalData('gameser_list');
     #------载入缓存------#
     if ($dataList) {
         Tools::import('Util_FontColor');
         $timeInterval = array();
         //定时器计时
         foreach ($dataList as &$list) {
             $list['url_dialog'] = Tools::url(CONTROL, 'OrderDialog', array('Id' => $list['Id']));
             $list['word_game_type'] = Util_FontColor::getGameTypeColor($list['game_type'], $gameTypeArr[$list['game_type']]);
             $list['word_source'] = Util_FontColor::getWorkOrderSource($list['source'], $workOrderSourceArr[$list['source']]);
             $list['word_status'] = Util_FontColor::getWorkOrderStatus($list['status'], $workOrderStatusArr[$list['status']]);
             $list['word_status'] .= $list['is_verify'] ? Tools::getLang('VERIFY_STATUS', 'Common') : '';
             $list['word_operator_id'] = $operatorList[$list['operator_id']];
             $list['word_question_type'] = $questionTypes[$list['question_type']] ? $questionTypes[$list['question_type']] : ' ';
             $list['url_detail'] = Tools::url('WorkOrder', 'Detail', array('Id' => $list['Id']));
             $list['word_owner_user_id'] = $users[$list['owner_user_id']]['nick_name'];
             $list['word_game_server_id'] = $serverList[$list['game_server_id']]['server_name'];
             $list['word_ev'] = Util_FontColor::getPlayerEvaluation($list['evaluation_status'], $evArr[$list['evaluation_status']]);
             //提问类型
             if ($list['evaluation_status'] == 3) {
                 $list['word_ev_desc'] = $badEvArr[$list['evaluation_desc']];
             }
             if ($list['status'] == 1) {
                 $isTimeout = Tools::isTimeOut($list['create_time'], $list['timeout']);
                 if ($isTimeout === true) {
                     //已超时
                     $list['time_out_true'] = true;
                 } else {
                     //未超时
                     $list['lost_time'] = Tools::getTimeFormat($isTimeout);
                     $timeInterval[$list['Id']]['div'] = $list['Id'];
                     $timeInterval[$list['Id']]['time'] = $isTimeout;
                 }
             }
             if ($serverList[$list['game_server_id']]['time_zone'] != 0) {
                 $list['create_time'] = date('Y-m-d H:i:s', $list['create_time'] + $serverList[$list['game_server_id']]['time_zone'] * 3600);
             } else {
                 $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
             }
             if ($list['word_owner_user_id']) {
                 $list['word_owner_user_id'] .= in_array($list['owner_user_id'], $onlineUsers) ? Util_FontColor::getOnline(1) : Util_FontColor::getOnline(0);
             }
         }
     }
     $timeInterval = json_encode($timeInterval);
     $this->_view->assign('dataList', $dataList);
     $dataList = $this->_view->fetch('MyTask/Ref.html');
     $output = array('dataList' => $dataList, 'timer' => $timeInterval);
     $this->_returnAjaxJson(array('status' => 1, 'msg' => null, 'data' => $output));
 }
Пример #16
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();
     }
 }
Пример #17
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;
 }
Пример #18
0
 /**
  * 运营商按天数统计
  */
 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();
 }
Пример #19
0
 /**
  * 添加查证处理
  */
 public function actionOrderVerify()
 {
     $this->_modelVerify = $this->_getGlobalData('Model_Verify', 'object');
     if ($this->_isPost()) {
         if (!$_POST['game_type_id'] || !$_POST['operator_id'] || !$_POST['game_server_id']) {
             $this->_utilMsg->showMsg(Tools::getLang('SELECT_COMPLETE_MSG', __CLASS__), -1);
         } else {
             $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
             $userClass = $this->_utilRbac->getUserClass();
             $addArr = array('user_id' => $userClass['_id'], 'department_id' => $_POST['department_id'], 'create_time' => CURRENT_TIME, 'game_type_id' => $_POST['game_type_id'], 'operator_id' => $_POST['operator_id'], 'game_server_id' => $_POST['game_server_id'], 'status' => $_POST['status'], 'type' => $_POST['type'], 'level' => $_POST['level'], 'title' => $_POST['title'], 'content' => $_POST['content'], 'game_user_id' => trim($_POST['game_user_id']), 'game_user_account' => $_POST['game_user_account'], 'game_user_nickname' => $_POST['game_user_nickname'], 'source' => $_POST['source']);
             if ($_POST['source_detail']) {
                 $addArr['source_detail'] = $_POST['source_detail'];
             }
             if ($_POST['work_order_id']) {
                 $addArr['work_order_id'] = $_POST['work_order_id'];
             }
             $addArr['log'] = array();
             array_push($addArr['log'], $this->_addLog(array('action' => 'add', 'status' => $_POST['status'])));
             $addArr['log'] = serialize($addArr['log']);
             if ($this->_modelVerify->add($addArr)) {
                 if ($_POST['work_order_id']) {
                     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
                     $this->_modelWorkOrder->update(array('is_verify' => 1), "Id={$_POST['work_order_id']}");
                     $this->_utilMsg->showMsg(false);
                 } else {
                     $this->_utilMsg->showMsg(false);
                 }
             } else {
                 $this->_utilMsg->showMsg(Tools::getLang('ADD_BUGLIST_ERROR', __CLASS__), -2);
             }
         }
     } else {
         $verifyStatus = $this->_getGlobalData('verify_status');
         $verifyType = $this->_getGlobalData('verify_type');
         $verifyLevel = $this->_getGlobalData('verify_level');
         $verifySource = $this->_getGlobalData('verify_source');
         $gameType = $this->_getGlobalData('game_type');
         //$gameType = Model::getTtwoArrConvertOneArr ( $gameType, 'Id', 'name' );
         $operatorList = $this->_getGlobalData('operator_list');
         //$operatorList = Model::getTtwoArrConvertOneArr ( $operatorList, 'Id', 'operator_name' );
         $gameServerList = $this->_getGlobalData('gameser_list');
         $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
         $userClass = $this->_utilRbac->getUserClass();
         $myGameType = array();
         $myGameOpt = array();
         $myOpt = array();
         if ($userClass['_operatorIds'] && is_array($userClass['_operatorIds'])) {
             foreach ($userClass['_operatorIds'] as $sub) {
                 $myGameOpt[$sub['game_type_id']][$sub['operator_id']] = $operatorList[$sub['operator_id']]['operator_name'];
                 $myOpt[$sub['operator_id']] = $operatorList[$sub['operator_id']]['operator_name'];
             }
             foreach ($myGameOpt as $gameId => $sub) {
                 $myGameType[$gameId] = $gameType[$gameId]['name'];
             }
         }
         $operatorList = $myOpt;
         $gameType = $myGameType;
         foreach ($gameServerList as &$list) {
             unset($list['room_id'], $list['marking'], $list['time_zone'], $list['server_url'], $list['full_name']);
         }
         $department = $this->_modelVerify->getDep();
         if (isset($_GET['work_order_id'])) {
             $this->_view->assign('workOrderId', $_GET['work_order_id']);
             $dataList = $this->_modelVerify->findByUserAccountWorkId($_GET['user_account'], $_GET['work_order_id']);
             if ($dataList) {
                 foreach ($dataList as &$value) {
                     $verifyTypeToGameType = $this->_getVerifyTypeByGameType($value['game_type_id']);
                     $value['word_game_type_id'] = $gameType[$value['game_type_id']];
                     $value['word_operator_id'] = $operatorList[$value['operator_id']];
                     $value['word_game_server_id'] = $gameServerList[$value['game_server_id']]['server_name'];
                     $value['word_status'] = $verifyStatus[$value['status']];
                     $value['word_type'] = $verifyTypeToGameType[$value['type']];
                     $value['word_level'] = $verifyLevel[$value['level']];
                     $value['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
                     $value['word_department_id'] = $department[$value['department_id']];
                     $value['url_detail'] = Tools::url(CONTROL, 'Detail', array('Id' => $value['Id'], 'work_order_id' => $_GET['work_order_id']));
                     if ($value['log']) {
                         $value['log'] = unserialize($value['log']);
                     }
                 }
                 $this->_view->assign('dataList', $dataList);
             }
         }
         #------selected------#
         $this->_view->assign('selectedGameTypeId', $_GET['game_type_id']);
         $this->_view->assign('selectedOperatorId', $_GET['operator_id']);
         $this->_view->assign('selectedServerId', $_GET['game_server_id']);
         $this->_view->assign('gameUserId', $_GET['game_user_id']);
         $this->_view->assign('userAccount', $_GET['user_account']);
         $this->_view->assign('userNickname', $_GET['user_nickname']);
         #------selected------#
         $this->_view->assign('verifySource', $verifySource);
         $this->_view->assign('gameServerList', json_encode($gameServerList));
         $this->_view->assign('department', $department);
         $this->_view->assign('verifyStatus', $verifyStatus);
         $this->_view->assign('verifyType', json_encode($verifyType));
         $this->_view->assign('verifyLevel', $verifyLevel);
         $this->_view->assign('gameType', $gameType);
         $this->_view->assign('operatorList', $operatorList);
         $this->_view->assign('js', $this->_view->get_curJs());
         if (!$_REQUEST['work_order_id']) {
             $this->_utilMsg->createNavBar();
         }
         $this->_view->display();
     }
 }