Beispiel #1
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);
     }
 }
 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));
 }
Beispiel #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);
     }
 }
Beispiel #4
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));
 }
Beispiel #5
0
 /**
  * 工单显示列表
  */
 public function actionIndex()
 {
     #------初始化------#
     $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');
     $this->_modelUser = $this->_getGlobalData('Model_User', 'object');
     $orgList = $this->_getGlobalData('org');
     foreach ($orgList as &$value) {
         $curOrgUser = $this->_modelUser->findByOrgId($value['Id']);
         if ($curOrgUser) {
             $curOrgUser = Model::getTtwoArrConvertOneArr($curOrgUser, 'Id', 'nick_name');
             $value['user'] = $curOrgUser;
         }
     }
     #------初始化------#
     $onlineUsers = $this->_utilOnline->getOnlineUser('user_id');
     //在线用户,一维数组,value值为user_id
     #------分页生成sql------#
     $helpSqlSearch = $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName());
     if ($_GET['game_type_id'] != '') {
         $helpSqlSearch->set_conditions("game_type={$_GET['game_type_id']}");
         $this->_view->assign('selectedGameTypeId', $_GET['game_type_id']);
     }
     if ($_GET['operator_id'] != '') {
         $helpSqlSearch->set_conditions("operator_id={$_GET['operator_id']}");
         $this->_view->assign('selectedOperatorId', $_GET['operator_id']);
     }
     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']);
     }
     $helpSqlSearch->setPageLimit($_GET['page'], 20);
     if ($_GET['order_status']) {
         $helpSqlSearch->set_conditions("status={$_GET['order_status']}");
         $this->_view->assign('selectedOrderStatus', $_GET['order_status']);
     }
     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']);
     }
     if ($_GET['service_ids']) {
         //如果选择了客服
         $this->_view->assign('selectedServiceIds', $_GET['service_ids']);
         $serviceIds = implode(',', $_GET['service_ids']);
         $helpSqlSearch->set_conditions("owner_user_id in ({$serviceIds})");
     }
     $helpSqlSearch->set_orderBy('create_time desc');
     $sql = $helpSqlSearch->createSql();
     $conditions = $helpSqlSearch->get_conditions();
     $this->_loadCore('Help_Page');
     $helpPage = new Help_Page(array('total' => $this->_modelWorkOrder->findCount($conditions), 'perpage' => 20));
     $this->_view->assign('pageBox', $helpPage->show());
     #------分页生成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');
     //		$users=Model::getTtwoArrConvertOneArr($users,'Id','full_name');
     $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('QualityCheck', '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);
     }
     $gameTypeArr[''] = '所有';
     $this->_view->assign('gameTypeList', $gameTypeArr);
     $operatorList[''] = '所有';
     $this->_view->assign('operatorList', $operatorList);
     $this->_view->assign('orgList', $orgList);
     $this->_view->assign('vipLevel', $vipLevel);
     $workOrderStatusArr[''] = '所有';
     $this->_view->assign('workOrderStatusArr', $workOrderStatusArr);
     $this->_view->assign('js', $this->_view->get_curJs());
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
Beispiel #6
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;
 }
 /**
  * 我质检过的工单
  */
 public function actionMyTask()
 {
     #------初始化------#
     $this->_modelUser = $this->_getGlobalData('Model_User', 'object');
     $this->_utilOnline = $this->_getGlobalData('Util_Online', 'object');
     $onlineUsers = $this->_utilOnline->getOnlineUser('user_id');
     //在线用户,一维数组,value值为user_id
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $serverList = $this->_getGlobalData('gameser_list');
     $serverList = Model::getTtwoArrConvertOneArr($serverList, 'Id', 'server_name');
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $userClass = $this->_utilRbac->getUserClass();
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $this->_loadCore('Help_Page');
     $this->_loadCore('Help_SqlSearch');
     $orgList = $this->_getGlobalData('org');
     $evArr = $this->_modelWorkOrder->getEvArr();
     //获取评价数组
     $badEvArr = $this->_getGlobalData('player_evaluation');
     $badEvArr = $badEvArr[3]['Description'];
     //差评数组
     foreach ($orgList as &$value) {
         $curOrgUser = $this->_modelUser->findByOrgId($value['Id']);
         if ($curOrgUser) {
             $curOrgUser = Model::getTtwoArrConvertOneArr($curOrgUser, 'Id', 'full_name');
             $value['user'] = $curOrgUser;
         }
     }
     #------初始化------#
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName());
     if ($_GET['game_type_id'] != '') {
         $helpSqlSearch->set_conditions("game_type={$_GET['game_type_id']}");
         $this->_view->assign('selectedGameTypeId', $_GET['game_type_id']);
         #------提问类型------#
         $questionTypes = $this->_getGlobalData('question_types');
         $qTypes = array();
         foreach ($questionTypes as $key => $list) {
             if ($list['game_type_id'] == $_GET['game_type_id']) {
                 $qTypes[$key] = $list['title'];
             }
         }
         unset($questionTypes);
         $qTypes[''] = Tools::getLang('ALL', 'Common');
         $this->_view->assign('qType', $qTypes);
         if ($_GET['question_type']) {
             $helpSqlSearch->set_conditions("question_type={$_GET['question_type']}");
             $this->_view->assign('selectedQtype', $_GET['question_type']);
         }
         #------提问类型------#
     }
     if ($_GET['operator_id'] != '') {
         $helpSqlSearch->set_conditions("operator_id={$_GET['operator_id']}");
         $this->_view->assign('selectedOperatorId', $_GET['operator_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']);
     }
     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']);
     }
     if ($_GET['service_ids']) {
         //如果选择了客服
         $this->_view->assign('selectedServiceIds', $_GET['service_ids']);
         $serviceIds = implode(',', $_GET['service_ids']);
         $helpSqlSearch->set_conditions("owner_user_id in ({$serviceIds})");
     }
     $helpSqlSearch->set_conditions("quality_id={$userClass['_id']}");
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     $helpSqlSearch->set_orderBy('create_time desc');
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     #------分页box------#
     $conditions = $helpSqlSearch->get_conditions();
     $helpPage = new Help_Page(array('total' => $this->_modelWorkOrder->findCount($conditions), 'perpage' => PAGE_SIZE));
     #------分页box------#
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelWorkOrder->select($sql);
     #------载入缓存------#
     $this->_modelSysconfig = $this->_getGlobalData('Model_Sysconfig', 'object');
     $this->_modelQuestionType = $this->_getGlobalData('Model_QuestionType', 'object');
     $gameTypeArr = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
     $vipLevel = Tools::getLang('VIP_LEVEL', 'Common');
     $workOrderSourceArr = $this->_modelSysconfig->getValueToCache('workorder_source');
     $workOrderStatusArr = $this->_modelSysconfig->getValueToCache('workorder_status');
     $userList = Model::getTtwoArrConvertOneArr($this->_getGlobalData('user'), 'Id', 'nick_name');
     #------载入缓存------#
     if ($dataList) {
         Tools::import('Util_FontColor');
         $users = $this->_getGlobalData('user');
         $users = Model::getTtwoArrConvertOneArr($users, 'Id', 'full_name');
         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'] ? '(查)' : '';
             $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(CONTROL, 'Dialog', array('Id' => $list['Id'], 'game_type_id' => $list['game_type'], 'operator_id' => $list['operator_id']));
             $list['word_owner_user_id'] = $users[$list['owner_user_id']];
             $list['word_game_server_id'] = $serverList[$list['game_server_id']];
             $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
             $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['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);
     }
     $gameTypeArr[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('gameTypeList', $gameTypeArr);
     $operatorList[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('operatorList', $operatorList);
     $this->_view->assign('orgList', $orgList);
     $this->_view->assign('vipLevel', $vipLevel);
     $workOrderStatusArr[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('workOrderStatusArr', $workOrderStatusArr);
     $this->_view->assign('pageBox', $helpPage->show());
     $this->_view->assign('js', $this->_view->get_curJs());
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
Beispiel #8
0
 /**
  * 工单显示列表
  */
 public function actionIndex()
 {
     #------初始化------#
     $this->_utilOnline = $this->_getGlobalData('Util_Online', 'object');
     $workOrderStatusArr = $this->_modelSysconfig->getValueToCache('workorder_status');
     $verifyStatusArr = $this->_getGlobalData('verify_status');
     //bug 状态
     $gameTypeArr = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $this->_modelUser = $this->_getGlobalData('Model_User', 'object');
     $orgList = $this->_getGlobalData('org');
     $evArr = $this->_modelWorkOrder->getEvArr();
     //获取评价数组
     $badEvArr = $this->_getGlobalData('player_evaluation');
     $badEvArr = $badEvArr[3]['Description'];
     //差评数组
     $questionTypes = $this->_getGlobalData('question_types');
     foreach ($orgList as &$value) {
         $curOrgUser = $this->_modelUser->findByOrgId($value['Id']);
         if ($curOrgUser) {
             $curOrgUser = Model::getTtwoArrConvertOneArr($curOrgUser, 'Id', 'nick_name');
             $value['user'] = $curOrgUser;
         }
     }
     $this->_modelRooms = $this->_getGlobalData('Model_Rooms', 'object');
     $roomList = $this->_modelRooms->findAll();
     $roomList = Model::getTtwoArrConvertOneArr($roomList, 'Id', 'name');
     $roomList[''] = Tools::getLang('All', 'Common');
     $this->_utilWorkOrder = $this->_getGlobalData('Util_WorkOrder', 'object');
     $orderManage = $this->_utilWorkOrder->getOrderManage();
     $orderVipNum = $orderManage['_orderNum'];
     $orderVipNum[''] = array_sum($orderVipNum);
     #------初始化------#
     $onlineUsers = $this->_utilOnline->getOnlineUser('user_id');
     //在线用户,一维数组,value值为user_id
     #------分页生成sql------#
     $helpSqlSearch = $this->_loadCore('Help_SqlSearch');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName());
     if ($_GET['game_type_id'] != '') {
         $helpSqlSearch->set_conditions("game_type={$_GET['game_type_id']}");
         $this->_view->assign('selectedGameTypeId', $_GET['game_type_id']);
         #------提问类型------#
         $qTypes = array();
         foreach ($questionTypes as $key => $list) {
             if ($list['game_type_id'] == $_GET['game_type_id']) {
                 $qTypes[$key] = $list['title'];
             }
         }
         $qTypes[''] = Tools::getLang('ALL', 'Common');
         $this->_view->assign('qType', $qTypes);
         if ($_GET['question_type']) {
             $helpSqlSearch->set_conditions("question_type={$_GET['question_type']}");
             $this->_view->assign('selectedQtype', $_GET['question_type']);
         }
         #------提问类型------#
         #------运营商------#
         $operatorListTemp = array();
         $gameOperatorIndex = $this->_getGlobalData('Model_GameOperator', 'object')->findByGameTypeId($_GET['game_type_id']);
         foreach ($gameOperatorIndex as $value) {
             if (array_key_exists($value['operator_id'], $operatorList)) {
                 $operatorListTemp[$value['operator_id']] = $operatorList[$value['operator_id']];
             }
         }
         $operatorList = $operatorListTemp;
         unset($operatorListTemp);
         #------运营商------#
     }
     if ($_GET['operator_id'] != '') {
         $helpSqlSearch->set_conditions("operator_id={$_GET['operator_id']}");
         $this->_view->assign('selectedOperatorId', $_GET['operator_id']);
     }
     //增加服务器选择列表
     if ($_GET['game_type_id'] != '' && $_GET['operator_id'] != '') {
         $gameOptServerLists = $this->_getServers($_GET['game_type_id'], $_GET['operator_id']);
         if ($_GET['server_id'] != '') {
             $helpSqlSearch->set_conditions('game_server_id=' . intval($_GET['server_id']));
         }
         $this->_view->assign('gameOptServerLists', $gameOptServerLists);
     }
     if ($_GET['Id']) {
         $helpSqlSearch->set_conditions("Id={$_GET['Id']}");
         $this->_view->assign('selectedId', $_GET['Id']);
     }
     if ($_GET['room_id']) {
         $helpSqlSearch->set_conditions("room_id={$_GET['room_id']}");
         $this->_view->assign('selectedRoomId', $_GET['room_id']);
     }
     if ($_GET['evaluation_status'] != '') {
         $helpSqlSearch->set_conditions("evaluation_status={$_GET['evaluation_status']}");
         $this->_view->assign('selectedEv', $_GET['evaluation_status']);
         if ($_GET['evaluation_status'] == 3) {
             //如果为差评
             $this->_view->assign('badev_display', true);
         }
     }
     if ($_GET['is_verify'] != '') {
         $helpSqlSearch->set_conditions("is_verify={$_GET['is_verify']}");
         $this->_view->assign('selectedIsVerify', $_GET['is_verify']);
     }
     if ($_GET['evaluation_desc'] != '') {
         $helpSqlSearch->set_conditions("evaluation_desc={$_GET['evaluation_desc']}");
         $this->_view->assign('selectedBadEv', $_GET['evaluation_desc']);
     }
     if ($_GET['vip_level'] != '') {
         //如果设置了vip等级,将显示等级
         $helpSqlSearch->set_conditions("vip_level={$_GET['vip_level']}");
         $this->_view->assign('selectedVipLevel', $_GET['vip_level']);
     }
     $helpSqlSearch->setPageLimit($_GET['page'], 20);
     if ($_GET['order_status']) {
         $helpSqlSearch->set_conditions("status={$_GET['order_status']}");
         $this->_view->assign('selectedOrderStatus', $_GET['order_status']);
     }
     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']);
     }
     if ($_GET['service_ids']) {
         //如果选择了客服
         $this->_view->assign('selectedServiceIds', $_GET['service_ids']);
         $serviceIds = implode(',', $_GET['service_ids']);
         $helpSqlSearch->set_conditions("owner_user_id in ({$serviceIds})");
     }
     if ($_GET['start_time'] && $_GET['end_time']) {
         $this->_view->assign('selectedStartTime', $_GET['start_time']);
         $this->_view->assign('selectedEndTime', $_GET['end_time']);
         $helpSqlSearch->set_conditions('create_time between ' . strtotime($_GET['start_time']) . ' and ' . strtotime($_GET['end_time']));
     }
     $helpSqlSearch->set_orderBy('status asc,create_time desc');
     $sql = $helpSqlSearch->createSql();
     $conditions = $helpSqlSearch->get_conditions();
     $this->_loadCore('Help_Page');
     $helpPage = new Help_Page(array('total' => $this->_modelWorkOrder->findCount($conditions), 'perpage' => 20));
     $this->_view->assign('pageBox', $helpPage->show());
     #------分页生成sql------#
     $dataList = $this->_modelWorkOrder->select($sql);
     #------载入缓存------#
     $workOrderSourceArr = $this->_modelSysconfig->getValueToCache('workorder_source');
     $vipLevel = Tools::getLang('VIP_LEVEL', 'Common');
     foreach ($vipLevel as $key => &$vipCount) {
         $vipCount .= " [<font color='#ff0000'>" . intval($orderVipNum[$key]) . "</font>]";
     }
     $users = $this->_getGlobalData('user_all');
     $serverList = $this->_getGlobalData('gameser_list');
     #------载入缓存------#
     if ($dataList) {
         Tools::import('Util_FontColor');
         $timeInterval = array();
         //定时器计时
         foreach ($dataList as &$list) {
             $TimeDifference = intval($serverList[$list['game_server_id']]['time_zone']);
             //时差
             $list['url_dialog'] = Tools::url('QualityCheck', 'OrderDialog', array('Id' => $list['Id'], 'TimeDifference' => $TimeDifference));
             $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']]['title'] ? $questionTypes[$list['question_type']]['title'] : Tools::getLang('NOT_QUESTION_TYPE', 'Common');
             $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']]);
             //提问类型
             $list['url_reply_detail'] = Tools::url(CONTROL, 'ReplyIndex', array('user_id' => $list['owner_user_id']));
             $list['word_room_id'] = $list['room_id'] ? $roomList[$list['room_id']] : '<font color="#666666">' . Tools::getLang('NOT', 'Common') . '</font>';
             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 ($TimeDifference != 0) {
                 $list['create_time'] = date('Y-m-d H:i:s', $list['create_time'] + $TimeDifference * 3600);
                 $list['create_time'] .= '(' . Tools::getLang('GAME_SERVER_TIME', 'Common') . ')';
             } 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);
             }
             $verifyInfo = $this->_modelWorkOrder->select('select status from ' . DB_PREFIX . 'verify ' . 'where work_order_id =' . $list['Id'], 1);
             $verifyStatus = $verifyInfo['status'];
             $list['word_verify_status'] = $verifyStatusArr[$verifyStatus];
         }
         $this->_view->assign('dataList', $dataList);
     }
     $evArr[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('statusurl', Tools::url(CONTROL, 'ChangetheStatus'));
     $badEvArr[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('verify', $this->_modelWorkOrder->getVerify());
     $this->_view->assign('badEvArr', $badEvArr);
     $this->_view->assign('evArr', $evArr);
     $this->_view->assign('roomList', $roomList);
     $this->_view->assign('timeInterval', json_encode($timeInterval));
     $gameTypeArr[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('gameTypeList', $gameTypeArr);
     $operatorList[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('operatorList', $operatorList);
     $this->_view->assign('orgList', $orgList);
     $this->_view->assign('vipLevel', $vipLevel);
     $workOrderStatusArr[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('workOrderStatusArr', $workOrderStatusArr);
     $this->_view->assign('js', $this->_view->get_curJs());
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
Beispiel #9
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();
 }