Esempio n. 1
0
 /**
  * 礼包卡号统计
  */
 public function actionLibaoCardState()
 {
     if (!$_REQUEST['game_type_id']) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'not game_type_id', 'data' => null));
     }
     if (!$_REQUEST['server_mark']) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'not server_mark', 'data' => null));
     }
     if (!$_REQUEST['type_id']) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'not type_id', 'data' => null));
     }
     if (!$_REQUEST['time']) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'not time', 'data' => null));
     }
     $this->_modelGameSerList = $this->_getGlobalData('Model_GameSerList', 'object');
     $serverDetail = $this->_modelGameSerList->findByMarking($_REQUEST['game_type_id'], $_REQUEST['server_mark']);
     if (!$serverDetail) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'game server non-existent'));
     }
     $cardId = $_REQUEST['type_id'];
     $time = $_REQUEST['time'];
     $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object');
     $getArr = array('c' => 'Card', 'a' => 'ImportCard', 'doaction' => 'state');
     $postArr = array('type_id' => $cardId, 'DateTime' => $time);
     $this->_utilApiFrg->addHttp($serverDetail['Id'], $getArr, $postArr);
     $this->_utilApiFrg->send();
     $data = $this->_utilApiFrg->getResult();
     if ($data) {
         $this->_returnAjaxJson(array('status' => 1, 'info' => null, 'data' => $data));
     } else {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'game server error', 'data' => null));
     }
 }
 public function actionWorkOrderList()
 {
     $userInfo = array('user_account' => trim($_REQUEST['user_account']), 'game_user_id' => trim($_REQUEST['user_id']), 'user_nickname' => trim(urldecode($_REQUEST['user_nickname'])));
     $userInfo = array_filter($userInfo);
     //检查用户信息是否都为空
     if (!$userInfo) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'player empty', 'data' => null));
     }
     $gameId = intval($_REQUEST['game_id']);
     if (!$gameId) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'error game_id', 'data' => null));
     }
     $serverMarking = trim($_REQUEST['server_marking']);
     if (empty($serverMarking)) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'server_marking empty', 'data' => null));
     }
     $this->_modelGameSerList = $this->_getGlobalData('Model_GameSerList', 'object');
     $gameServerList = $this->_modelGameSerList->findByMarking($gameId, $serverMarking);
     if (!$gameServerList) {
         //未找到服务器
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'game server non-existent', 'data' => null));
     }
     $status = intval($_REQUEST['status']);
     $ev = trim($_REQUEST['ev']);
     $page = max(1, intval($_REQUEST['page']));
     $pageSize = intval($_REQUEST['page_size']);
     if ($pageSize < 1 || $pageSize > 100) {
         $pageSize = 10;
     }
     $this->_loadCore('Help_SqlSearch');
     //载入sql工具
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName());
     $helpSqlSearch->set_field('Id as id,question_type as type,title,create_time as update_time,evaluation_status as ev,status,evaluation_desc as ev_desc,is_read');
     //指定玩家
     $helpSqlSearch->set_conditions(key($userInfo) . "='" . current($userInfo) . "'");
     //来自游戏的工单
     $helpSqlSearch->set_conditions('source=2');
     //来自哪个游戏
     $helpSqlSearch->set_conditions("is_vip='0'");
     $helpSqlSearch->set_conditions("game_type={$gameId}");
     //确定某个服务器
     $helpSqlSearch->set_conditions("game_server_id={$gameServerList['Id']}");
     //处理状态,0:待受理(包括:1未受理,2受理中),3:已答复 ,4:删除的 ,-1: 表示全部
     if ($status != -1) {
         if ($status == 0) {
             $helpSqlSearch->set_conditions('status>=1');
             $helpSqlSearch->set_conditions('status<=2');
         } else {
             $helpSqlSearch->set_conditions('status=3');
         }
     } else {
         $helpSqlSearch->set_conditions('status<>4');
     }
     //评价状态
     if ($ev == '0') {
         $helpSqlSearch->set_conditions('evaluation_status=0');
     } elseif ($ev) {
         $helpSqlSearch->set_conditions('evaluation_status=' . intval($ev));
     }
     //分页
     $helpSqlSearch->setPageLimit($page, $pageSize);
     //排序
     $helpSqlSearch->set_orderBy('is_read,Id desc');
     $sql = $helpSqlSearch->createSql();
     $conditions = $helpSqlSearch->get_conditions();
     $dataList = $this->_modelWorkOrder->select($sql);
     $total = $this->_modelWorkOrder->findCount($conditions);
     $returnData = array('list' => $dataList, 'query_status' => $status, 'total' => $total, 'page' => $page);
     $this->_returnAjaxJson(array('status' => 1, 'info' => CONTROL . '_' . ACTION, 'data' => $returnData));
 }
 /**
  * 游戏内提问
  */
 private function _saveSource2()
 {
     $orderArr = array();
     $orderArr['game_type'] = $_POST['game_id'];
     $orderArr['user_account'] = $_POST['user_account'];
     $orderArr['user_nickname'] = $_POST['user_nickname'];
     $orderArr['money'] = $_POST['money_total'];
     $orderArr['source'] = $_POST['source'];
     //工单来源
     $orderArr['title'] = $_POST['title'];
     $orderArr['question_type'] = $_POST['question_type'];
     $orderArr['question_num'] = 1;
     $orderArr['create_time'] = CURRENT_TIME;
     if ($_FILES['image']) {
         $updateInfo = $this->_upload();
     }
     //如果有上传图片就上传文件
     $serverMarking = $_POST['server_marking'];
     $gameServerList = $this->_modelGameSerList->findByMarking($_POST['game_id'], $serverMarking);
     if (!$gameServerList) {
         //未找到服务器
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'game server non-existent', 'data' => null));
     }
     $this->_modelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object');
     $gameOperatorIndex = $this->_modelGameOperator->findByGidOId($_POST['game_id'], $gameServerList['operator_id']);
     //找到此运营商的详细 资料.
     if (!$gameOperatorIndex) {
         //未找到游戏与运营商的索引
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'game server non-existent', 'data' => null));
     }
     $orderArr['vip_level'] = $this->_modelGameOperator->getVipLevel($gameOperatorIndex['vip_setup']['vip_pay'], $_POST['money_total']);
     $orderArr['timeout'] = $this->_modelGameOperator->getTimeOut($gameOperatorIndex['vip_setup']['vip_timeout'], $orderArr['vip_level']);
     $orderArr['timeout'] *= 60;
     //换成秒
     $orderArr['operator_id'] = $gameServerList['operator_id'];
     $orderArr['game_server_id'] = $gameServerList['Id'];
     if ($gameServerList['room_id']) {
         $orderArr['room_id'] = $gameServerList['room_id'];
     }
     if (!$this->_modelWorkOrder->add($orderArr)) {
         //创建表单失败
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'Failure to create order', 'data' => null));
     }
     #------为房间工单数加1------#
     if ($orderArr['room_id']) {
         $this->_utilRooms = $this->_getGlobalData('Util_Rooms', 'object');
         $roomCLass = $this->_utilRooms->getRoom($orderArr['room_id']);
         $roomCLass->addOrderNum(1);
         $roomCLass->setUpdateInfo(1);
         $roomCLass = null;
     }
     #------为房间工单数加1------#
     $workOrderId = $this->_modelWorkOrder->returnLastInsertId();
     //获取工单id
     #------增加新的工单到队列------#
     if ($orderArr['room_id']) {
         $addOrder = array('Id' => $workOrderId, 'vip_level' => $orderArr['vip_level'], 'room_id' => $orderArr['room_id'], 'game_type_id' => $orderArr['game_type'], 'operator_id' => $orderArr['operator_id']);
         $this->_utilWorkOrder = $this->_getGlobalData('Util_WorkOrder', 'object');
         $orderManageClass = $this->_utilWorkOrder->getOrderManage();
         $orderManageClass->addOrder($addOrder);
         $orderManageClass->setUpdateInfo(1);
         $orderManageClass = null;
     }
     #------增加新的工单到队列------#
     $orderDetail = array();
     $orderDetail['form_detail'] = array();
     $orderDetail['user_data'] = array('user_id' => $_POST['user_id'], 'user_account' => $_POST['user_account'], 'user_nickname' => $_POST['user_nickname'], 'money_total' => $_POST['money_total'], 'money_month' => $_POST['money_month'], 'register_date' => $_POST['register_date'], 'ip' => $_POST['ip']);
     $orderDetail = serialize($orderDetail);
     $this->_modelWorkOrderDetail = $this->_getGlobalData('Model_WorkOrderDetail', 'object');
     $this->_modelWorkOrderDetail->add(array('work_order_id' => $workOrderId, 'content' => $orderDetail));
     #-----插入对话表------#
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $content = $_POST['content'];
     if ($updateInfo['web_path']) {
         $content .= "<br>玩家截图:<br> <img src='{$updateInfo['web_path']}' />";
     }
     $orderDialog = array('game_type_id' => $_POST['game_id'], 'operator_id' => $orderArr['operator_id'], 'work_order_id' => $workOrderId, 'qa' => '0', 'content' => $content, 'create_time' => CURRENT_TIME);
     $this->_modelWorkOrderQa->add($orderDialog);
     //		if (!Tools::isUtf8($content))echo 'is not utf8';
     #-----插入对话表------#
     $this->_returnAjaxJson(array('status' => 1, 'info' => null, 'data' => array('order_id' => $workOrderId, 'image_path' => $updateInfo['web_path'])));
 }
Esempio n. 4
0
 private function _saveSource4()
 {
     $orderArr = array();
     $orderArr['game_type'] = intval($_POST['game_id']);
     $orderArr['is_vip'] = intval($_GET['is_vip']);
     $orderArr['user_account'] = $_POST['user_account'] ? $_POST['user_account'] : 0;
     $orderArr['user_nickname'] = trim($_POST['user_nickname']);
     $orderArr['money'] = intval($_POST['money_total']);
     $orderArr['source'] = intval(4);
     //工单来源
     $orderArr['title'] = strip_tags($_POST['title']);
     $orderArr['question_type'] = intval($_POST['question_type']);
     $orderArr['question_num'] = 1;
     $orderArr['create_time'] = CURRENT_TIME;
     $orderArr['game_user_id'] = trim($_POST['user_id']);
     if ($_FILES['image']) {
         $updateInfo = $this->_upload();
         //如果有上传图片就上传文件
     }
     $serverMarking = trim($_POST['server_marking']);
     $gameServerList = $this->_modelGameSerList->findByMarking($_POST['game_id'], $serverMarking, $_POST['server_name']);
     if (!$gameServerList) {
         //未找到服务器
         $this->_utilMsg->showMsg("game server non-existent", 1);
         //			$this->_returnAjaxJson ( array ('status' => 0, 'info' => 'game server non-existent', 'data' => null ) );
     }
     $this->_modelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object');
     $gameOperatorIndex = $this->_modelGameOperator->findByGidOId($_POST['game_id'], $gameServerList['operator_id']);
     //找到此运营商的详细 资料.
     if (!$gameOperatorIndex) {
         //未找到游戏与运营商的索引
         $this->_utilMsg->showMsg("game server or operator non-existent", 1);
         //			$this->_returnAjaxJson ( array ('status' => 0, 'info' => 'game server or operator non-existent', 'data' => null ) );
     }
     //vip等级,如果从游戏中有传$_POST['vip_level']过来,就使用$_POST['vip_level'],否则使用配置值
     $orderArr['vip_level'] = isset($_REQUEST['vip']) ? intval($_REQUEST['vip']) : $this->_modelGameOperator->getVipLevel($gameOperatorIndex['vip_setup']['vip_pay'], $_POST['money_total']);
     $orderArr['vip_level'] = min(6, $orderArr['vip_level']);
     $orderArr['timeout'] = $this->_modelGameOperator->getTimeOut($gameOperatorIndex['vip_setup']['vip_timeout'], $orderArr['vip_level']);
     $orderArr['timeout'] *= 60;
     //换成秒
     $orderArr['is_verify'] = 0;
     $orderArr['operator_id'] = $gameServerList['operator_id'];
     $orderArr['game_server_id'] = $gameServerList['Id'];
     $orderArr['is_read'] = 0;
     if ($gameServerList['room_id']) {
         $orderArr['room_id'] = $gameServerList['room_id'];
     }
     if (!$this->_modelWorkOrder->add($orderArr)) {
         //创建表单失败
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'Failure to create order', 'data' => null));
     }
     $workOrderId = $this->_modelWorkOrder->returnLastInsertId();
     //获取工单id
     #------追加日志------#
     $this->_modelOrderLog = $this->_getGlobalData('Model_OrderLog', 'object');
     $this->_modelOrderLog->addLog(array('game_type_id' => $orderArr['game_type'], 'operator_id' => $orderArr['operator_id'], 'server_id' => $orderArr['game_server_id'], 'Id' => $workOrderId), Model_OrderLog::ASK);
     #------追加日志------#
     #------增加新的工单到队列------#
     if ($orderArr['room_id']) {
         $addOrder = array('Id' => $workOrderId, 'vip_level' => $orderArr['vip_level'], 'room_id' => $orderArr['room_id'], 'game_type_id' => $orderArr['game_type'], 'operator_id' => $orderArr['operator_id']);
         $this->_utilWorkOrder = $this->_getGlobalData('Util_WorkOrder', 'object');
         $orderManageClass = $this->_utilWorkOrder->getOrderManage();
         $orderManageClass->addOrder($addOrder);
         $orderManageClass = null;
     }
     #------增加新的工单到队列------#
     $orderDetail = array();
     $orderDetail['form_detail'] = array();
     $orderDetail['user_data'] = array('user_id' => $_POST['user_id'], 'user_account' => $_POST['user_account'], 'user_nickname' => $_POST['user_nickname'], 'money_total' => isset($_POST['money_total']) ? $_POST['money_total'] : -1, 'money_month' => isset($_POST['money_month']) ? $_POST['money_month'] : -1, 'register_date' => !$_POST['register_date'] || $_POST['register_date'] == 'null' ? null : $_POST['register_date'], 'ip' => $_POST['ip']);
     //钻类型
     if (isset($_POST['flatType'])) {
         $orderDetail['ext']['flatType']['desc'] = '钻类型';
         switch ($_POST['flatType']) {
             case '1':
                 $orderDetail['ext']['flatType']['value'] = '<font color="#FF9900">黄钻</font>';
                 break;
             case '10':
                 $orderDetail['ext']['flatType']['value'] = '<font color="#0000FF">蓝钻</font>';
                 break;
             default:
                 $orderDetail['ext']['flatType']['value'] = '<font color="#999999">无</font>';
         }
     }
     //钻等级
     if (isset($_POST['diamondLevel'])) {
         $orderDetail['ext']['diamondLevel'] = array('desc' => '钻等级', 'value' => $_POST['diamondLevel']);
     }
     //是否年费黄钻
     if (isset($_POST['yearDiamond'])) {
         $orderDetail['ext']['yearDiamond'] = array('desc' => '是否年费', 'value' => $_POST['yearDiamond'] ? '是' : '否');
     }
     //游戏VIP等级
     if (isset($_POST['vip'])) {
         $orderDetail['ext']['vip'] = array('desc' => '游戏VIP等级', 'value' => $_POST['vip']);
     }
     $orderDetail = serialize($orderDetail);
     $this->_modelWorkOrderDetail = $this->_getGlobalData('Model_WorkOrderDetail', 'object');
     $this->_modelWorkOrderDetail->add(array('work_order_id' => $workOrderId, 'content' => $orderDetail));
     #-----插入对话表------#
     $retArr = array('order_id' => $workOrderId);
     $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object');
     $content = strip_tags($_POST['content']);
     $content = str_replace(array('\\r\\n', '\\r'), chr(10), $content);
     $orderDialog = array('user_id' => 0, 'game_type_id' => $_POST['game_id'], 'operator_id' => $orderArr['operator_id'], 'work_order_id' => $workOrderId, 'qa' => '0', 'content' => $content, 'create_time' => CURRENT_TIME);
     if ($updateInfo && is_array($updateInfo)) {
         $_imgArr = array();
         $i = '';
         foreach ($updateInfo as $img) {
             $retArr["image_path{$i}"] = $img['web_path'];
             $i++;
             $_imgArr[] = str_replace(__ROOT__, '', $img["web_path"]);
         }
         $orderDialog['image'] = json_encode($_imgArr);
     }
     $this->_modelWorkOrderQa->add($orderDialog);
     //$orderArr["room_id"]
     if ($orderArr['room_id'] && $gameServerList['server_url'] && $_POST['user_id']) {
         $this->_autoreply($orderArr, $gameServerList['server_url']);
     }
     #-----插入对话表------#
     eaccelerator_rm('question_' . $orderArr['user_account']);
     eaccelerator_put('question_' . $orderArr['user_account'], md5($orderArr['user_account'] . $orderArr['title']), 60);
     $this->_utilMsg->showMsg("提交成功", 1);
 }