/** * 收回炼狱值 */ public function actionChangeCarPurVal() { $this->_createServerList(); if ($this->_isPost()) { $postData = array('UserId' => intval($_POST['UserId']), 'CarState' => trim($_POST['CarState']), 'PurVal' => intval($_POST['PurVal']), 'TimePoint' => trim($_POST['TimePoint']), 'EndTimePoint' => trim($_POST['EndTimePoint']), 'index' => intval($_POST['index']), 'NotIds' => trim($_POST['NotIds']), 'Page' => max(1, intval($_POST['Page']))); if ($postData['CarState'] !== '' && !in_array(intval($postData['CarState']), array(0, 1, 2))) { $this->_utilMsg->showMsg('操作(1为加,0为减,2为查询)', -1); } if (!in_array($postData['index'], array(1, 2, 3, 4, 5))) { $this->_utilMsg->showMsg('事件表列号(1-5)', -1); } $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); if ($_POST['showPurVal']) { $getData = array('c' => 'UserData', 'a' => 'UserTune', 'doaction' => 'SelPurVal'); } else { $getData = array('c' => 'UserData', 'a' => 'UserTune', 'doaction' => 'ChangeCarPurVal'); } $this->_utilFRGInterface->setGet($getData); $this->_utilFRGInterface->setPost($postData); $data = $this->_utilFRGInterface->callInterface(); $this->_view->assign('UserId', $data['data']['UserId']); $this->_view->assign('OldPurVal', $data['data']['OldPurVal']); $this->_view->assign('NewPurVal', $data['data']['NewPurVal']); $this->_view->assign('PurValLog', $data['data']['PurValLog']); $this->_view->assign('UserMore', $data['data']['UserMore']); } $this->_utilMsg->createNavBar(); $this->_view->display(); }
/** * 获取富人国游戏人物信息,,将信息保存至$_userDetail属性 */ private function _getFrgUser() { $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($this->_serverId); $this->_utilFRGInterface->setGet(array('c' => 'UserData', 'a' => 'UserQuery', 'doaction' => 'SearchVUserName')); $this->_utilFRGInterface->setPost(array('UserNameStr' => $this->_userAccount)); $data = $this->_utilFRGInterface->callInterface(); Tools::dump($data); $this->_userDetail = array('user_id' => $data[0]['Id'], 'user_account' => $this->_userAccount, 'user_nickname' => $data[0]['VUserName'], 'money_total' => '', 'money_month' => '', 'register_date' => $data[0]['RegTime'], 'ip' => $data[0]['RegIp']); }
private function _getBto2User() { import('@.Util.FRGInterface'); $this->_FRGInterface = new FRGInterface(); $this->_FRGInterface->setServerUrl($this->_serverId); $this->_FRGInterface->setGet(array('m' => 'Admin', 'c' => 'UserData', 'a' => 'UserQuery', 'doaction' => 'SearchUserName')); $this->_FRGInterface->setPost(array('UserNameStr' => $this->_userAccount)); $data = $this->_FRGInterface->callInterface(); $data = array_shift($data['backparams']); $this->_userDetail = array('user_id' => $data['Id'], 'user_account' => $this->_userAccount, 'user_nickname' => $data['VUserName'], 'money_total' => $data['money_total'], 'money_month' => $data['money_month'], 'register_date' => $data['RegTime'], 'ip' => $this->get_client_ip()); }
/** * 特殊批量修改 * @author php-兴源 */ private function _spActivityEdit() { set_time_limit(100); //设置max_execution_time $this->_createServerList(); if ($this->_isPost()) { //提交表单 if (!count($_POST['server_ids'])) { $this->_utilMsg->showMsg(Tools::getLang('PLEASE_SELECTSERVER', 'Common'), -1); } $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object'); $this->_utilApiFrg->setTimeOut(90); //设置CURL超时时间 $post = $_POST; unset($post['server_ids'], $post['special_activity_id'], $post['Id']); $getArr = array('c' => 'Activity', 'a' => 'AddSpecialActivity', 'action' => 'save'); foreach ($_POST['server_ids'] as $key => $serverId) { $curPost = $post; $curPost['Id'] = $_POST['special_activity_id'][$key]; $this->_utilApiFrg->addHttp($serverId, $getArr, $curPost); } $this->_utilApiFrg->send(); // $resules = $this->_utilApiFrg->getResults(); // $successMsg = Tools::getLang('OPERATION_SUCCESS','Common'); $this->_utilMsg->showMsg(Tools::getLang('OPERATION_SUCCESS', 'Common'), 1, Tools::url(CONTROL, ACTION, array('zp' => self::PACKAGE))); } else { //显示表单 $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); //初始化连接url地址 $this->_utilFRGInterface->setGet(array('c' => 'Activity', 'a' => 'AddSpecialActivity', 'Id' => $_GET['special_activity_id'], 'zp' => self::PACKAGE)); $data = $this->_utilFRGInterface->callInterface(); if ($data) { //同一个标题下表单服务器列表 $this->_modelFrgSpecialActivity = $this->_getGlobalData('Model_HaiDaoSpecialActivity', 'object'); $servers = $this->_modelFrgSpecialActivity->findServers($_GET); $servers = $servers['data']['servers']; $this->_view->assign('servers', $servers); $data['data']['Activity']['word_Identifier'] = $data['data']['ActivityTypes'][$data['data']['Activity']['Identifier']]['Description']; $this->_view->assign('types', $data['data']['ActivityTypes']); $this->_view->assign('rewardsList', $data['data']['AwardsForm']); $this->_view->assign('dataList', $data['data']['Activity']); } else { $this->_view->assign('errorConn', Tools::getLang('CONNECT_SERVER_ERROR', 'Common')); } } $this->_view->set_tpl(array('body' => 'OperationFRG/SpecialActivityEdit.html')); $this->_utilMsg->createPackageNavBar(); $this->_view->display(); }
public function actionOrderPk() { $this->_createServerList(); if ($this->_isPost()) { $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'UserData', 'a' => 'OrderPk')); $postData = array('UserId' => $_POST["userid"]); $this->_utilFRGInterface->setPost($postData); $data = $this->_utilFRGInterface->callInterface(); print_r($data); } $this->_utilMsg->createPackageNavBar(); $this->_view->display(); }
private function _itemsToolRecList() { $this->_createServerList(); if ($_REQUEST['server_id']) { $player = array('txtids' => trim($_GET['playerId']), 'txtnames' => trim($_GET['playerAccount']), 'txtvnames' => trim($_GET['playerNickname'])); $player = array_filter($player); if ($player) { $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'UserData', 'a' => 'ShowToolDeleted')); $postData = array(key($player) => current($player), 'userflag' => key($player)); $this->_utilFRGInterface->setPost($postData); $data = $this->_utilFRGInterface->callInterface(); $this->_view->assign('username', current($player)); $this->_view->assign('datalist', $data["data"]["UserTools"]); } $this->_view->assign("serverid", $_REQUEST['server_id']); } $this->_view->assign("ajaxurl", Tools::url(CONTROL, 'ToolRec', array("zp" => "HaiDao", "doaction" => "rec", 'server_id' => $_REQUEST['server_id']))); $this->_utilMsg->createPackageNavBar(); $this->_view->display(); }
/** * 充值礼包管理 */ public function actionPayLibao() { switch ($_GET['doaction']) { case 'add': //增加 if ($this->_isPost()) { $_POST['ToolId'] = $_POST['Tool']; $_POST['ToolIdName'] = $_POST['ToolName']; $_POST['ToolIdImg'] = $_POST['ToolImg']; unset($_POST['Tool'], $_POST['ToolName'], $_POST['ToolImg']); $sendParams = Tools::getFilterRequestParam(); $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'Card', 'a' => 'PackageAdd', 'doaction' => 'Save')); $this->_utilFRGInterface->setPost($sendParams); $data = $this->_utilFRGInterface->callInterface(); if ($data) { if ($data['msgno'] == 1) { $this->_utilMsg->showMsg($data['message'], 1, Tools::url(CONTROL, ACTION, array('zp' => self::PACKAGE, 'server_id' => $_POST['server_id']))); } else { $this->_utilMsg->showMsg($data['message'], -2, 2); } } else { $this->_utilMsg->showMsg($data['message'], -2); } } else { $this->_createServerList(); // $this->_utilFRGInterface=$this->_getGlobalData('Util_FRGInterface','object'); // $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); // $this->_utilFRGInterface->setGet(array('c'=>'Card','a'=>'PackageAdd')); // $data=$this->_utilFRGInterface->callInterface(); $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); //初始化连接url地址 $this->_utilFRGInterface->setGet(array('c' => 'Reward', 'a' => 'Add')); $data = $this->_utilFRGInterface->callInterface(); if ($data) { Tools::import('Util_FRGTools'); $this->_utilFRGTools = new Util_FRGTools($data['data']['ObjData'], $data['data']['ToolData'], $data['data']['ObjProp']); $this->_view->assign('objData', json_encode($data['data']['ObjData'])); $this->_view->assign('toolData', json_encode($data['data']['ToolData'])); $this->_view->assign('effData', json_encode($this->_utilFRGTools->get_effData())); $this->_view->assign('systemTime', $data['data']['SYSTEM_TIME']); } $this->_utilMsg->createPackageNavBar(); $this->_view->set_tpl(array('body' => 'HaiDao/HaiDaoMaster/PayLibaoAdd.html')); $this->_view->display(); } break; case 'edit': //编辑 if ($this->_isPost()) { $_POST['ToolId'] = $_POST['Tool']; $_POST['ToolIdName'] = $_POST['ToolName']; $_POST['ToolIdImg'] = $_POST['ToolImg']; unset($_POST['Tool'], $_POST['ToolName'], $_POST['ToolImg']); $sendParams = Tools::getFilterRequestParam(); $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'Card', 'a' => 'PackageAdd', 'doaction' => 'Save')); $this->_utilFRGInterface->setPost($sendParams); $data = $this->_utilFRGInterface->callInterface(); if ($data) { if ($data['msgno'] == 1) { $this->_utilMsg->showMsg($data['message'], 1, Tools::url(CONTROL, ACTION, array('zp' => self::PACKAGE, 'server_id' => $_POST['server_id']))); } else { $this->_utilMsg->showMsg($data['message'], -2, 2); } } else { $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -2); } } else { $this->_createServerList(); $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'Card', 'a' => 'PackageAdd', 'Id' => $_GET['Id'])); $data = $this->_utilFRGInterface->callInterface(); if ($data) { Tools::import('Util_FRGTools'); $this->_utilFrgTools = new Util_FRGTools($data['data']['ObjData'], $data['data']['ToolData'], $data['data']['ObjProp']); $this->_view->assign('objData', json_encode($this->_utilFrgTools->get_objData())); $this->_view->assign('toolData', json_encode($this->_utilFrgTools->get_toolData())); $this->_view->assign('effData', json_encode($this->_utilFrgTools->get_effData())); $this->_view->assign('data', $data['data']['Reward']); $this->_utilFrgTools->setEditResult($data['data']['Reward']); $dataResult = $this->_utilFrgTools->getEditResult(); $this->_view->assign('chageCond', $dataResult['chageCond']); $this->_view->assign('chageEffect', $dataResult['chageEffect']); $this->_view->assign('chageTool', $dataResult['chageTool']); $this->_view->assign('num', $this->_utilFrgTools->getEditNum()); $this->_view->assign('systemTime', $data['data']['SYSTEM_TIME']); $this->_view->assign('timesDetail', $data['data']['Reward']['TimesDetail']); } $this->_utilMsg->createPackageNavBar(); $this->_view->set_tpl(array('body' => 'HaiDao/HaiDaoMaster/PayLibaoEdit.html')); $this->_view->assign('systemTime', $data['data']['SYSTEM_TIME']); $this->_view->display(); } break; case 'del': $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $sendParams = Tools::getFilterRequestParam(); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'Card', 'a' => 'PackageList', 'doaction' => 'delete')); $this->_utilFRGInterface->setPost($sendParams); $data = $this->_utilFRGInterface->callInterface(); if ($data) { if ($data['msgno'] == 1) { $this->_utilMsg->showMsg($data['message'], 1, Tools::url(CONTROL, ACTION, array('zp' => self::PACKAGE, 'server_id' => $_POST['server_id']))); } else { $this->_utilMsg->showMsg($data['message'], -2, 1); } } else { $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -2); } break; case 'proportion': //比例设置 if ($this->_isPost()) { Tools::import('Util_FRGInterface'); if ($_POST['subaction'] == 'set_count') { $this->_utilFRGInterface = new Util_FRGInterface(); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $sendParams = Tools::getFilterRequestParam(); $this->_utilFRGInterface->setGet(array('c' => 'Conf', 'a' => 'vartype', 'doaction' => 'saveadd')); $this->_utilFRGInterface->setPost($sendParams); $data = $this->_utilFRGInterface->callInterface(); if ($data) { if ($data['msgno'] == 1) { $this->_utilMsg->showMsg($data['message'], 1); } else { $this->_utilMsg->showMsg($data['message'], -2, 2); } } else { $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -2); } } else { $this->_utilFRGInterface = new Util_FRGInterface(); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $sendParams = Tools::getFilterRequestParam(); $this->_utilFRGInterface->setGet(array('c' => 'Conf', 'a' => 'vartype', 'doaction' => 'saveedit', 'CatId' => 1)); $this->_utilFRGInterface->setPost($sendParams); $data = $this->_utilFRGInterface->callInterface(); if ($data) { if ($data['msgno'] == 1) { $this->_utilMsg->showMsg($data['message'], 1); } else { $this->_utilMsg->showMsg($data['message'], -2, 2); } } else { $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -2); } } } else { $this->_createServerList(); Tools::import('Util_FRGInterface'); $this->_utilFRGInterface = new Util_FRGInterface(); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'Conf', 'a' => 'vartype', 'showaction' => 'edit', 'CatId' => 1)); $data = $this->_utilFRGInterface->callInterface(); $arrarCount = $data['data']['SystemVars']['247']['ArrayCount']; $var = $data['data']['SystemVars']['247']['VarValue']; $payProportion = array(); for ($i = 0; $i < $arrarCount; $i++) { $key = $var[$i][0] ? $var[$i][0] : $i; $payProportion[$key] = $var[$i][1] ? $var[$i][1] : $i; } $this->_view->assign('payProportion', $payProportion); $this->_utilFRGInterface->clearGet(); $this->_utilFRGInterface->setGet(array('c' => 'Conf', 'a' => 'vartype', 'showaction' => 'addvar', 'VarName' => 'DepositRatio')); $num = $this->_utilFRGInterface->callInterface(); $this->_view->assign('num', $num['data']['ConfVar']); $this->_utilMsg->createPackageNavBar(); $this->_view->set_tpl(array('body' => 'HaiDao/HaiDaoMaster/PayLibaoProportion.html')); $this->_view->display(); break; } case 'serverSyn': $this->_payLibaoServerSyn(); return; default: $this->_createServerList(); if ($_REQUEST['server_id']) { $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'Card', 'a' => 'PackageList')); $data = $this->_utilFRGInterface->callInterface(); if ($data) { if ($data['data']['Data']) { foreach ($data['data']['Data'] as &$list) { $list['url_edit'] = Tools::url(CONTROL, ACTION, array('zp' => self::PACKAGE, 'doaction' => 'edit', 'Id' => $list['Id'], 'server_id' => $_REQUEST['server_id'])); } $this->_view->assign('dataList', $data['data']['Data']); } } else { $this->_view->assign('errorConn', Tools::getLang('CONNECT_SERVER_ERROR', 'Common')); } } $this->_utilMsg->createPackageNavBar(); $this->_view->display(); } }
/** * 根据id来接收一个请求 * @param int $id * @return boolean/string */ private function _acceptId($id) { $data = $this->findById($id); if (!in_array($data['type'], $this->_options)) { return "Id:{$id} : <font color='#FF0000'>您没有权限审核这项</font>."; } if ($this->_operatorsLimit && !in_array($data['operator_id'], $this->_operatorsLimit)) { return "Id:{$id} : <font color='#FF0000'>您没有权限审核这项</font>."; } if ($data) { $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); $userClass = $this->_utilRbac->getUserClass(); if ($data['is_send'] == 1) { return "Id:{$id} 已经被审核过"; } if ($data['type'] >= 10) { //如果是批量审核的话 switch ($data['type']) { case '10': //多服务器发送奖励 $serverList = $this->_getGlobalData('gameser_list'); $data['post_data'] = unserialize($data['post_data']); $data['post_data']['send_players'] = str_replace('\\', '', $data['post_data']['send_players']); //去除\,好反序列化 $sendPlayerIds = unserialize($data['post_data']['send_players']); //得到要发送的玩家 unset($data['post_data']['send_players']); //删除掉这些玩家,一会好发送post数据给游戏接口 $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object'); $this->_utilApiFrg->curlInit(); $getArr = unserialize($data['send_action']); foreach ($sendPlayerIds as $key => $list) { $data['post_data']['UserIds'] = implode(',', $list); //加自要发送的玩家ID $data['post_data']['UserIds'] = str_replace(' ', '', $data['post_data']['UserIds']); //去掉空格 $this->_utilApiFrg->addHttp($key, $getArr, $data['post_data']); } $this->_utilApiFrg->send(); $sendResult = array(); $result = $this->_utilApiFrg->getResults(); foreach ($result as $key => $backParams) { $color = $backParams['msgno'] == 1 ? '#00CC00' : '#ff0000'; //定义颜色 $message = $backParams['msgno'] == 1 ? '发送成功' : '发送失败'; $backParams['message'] = $backParams['message'] ? $backParams['message'] : $message; if ($backParams) { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; $string = $this->_createAcceptMsg(1, $backParams, $string); //发送消息 array_push($sendResult, $string); } else { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; array_push($sendResult, $string); } } $retStr = implode('<br>', $sendResult); $this->update(array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => $retStr), "Id={$id}"); $this->_utilApiFrg = null; return $retStr; case '11': //多服务器奖励触发 $serverList = $this->_getGlobalData('gameser_list'); $data['post_data'] = unserialize($data['post_data']); $serverIds = $data['post_data']['server_ids']; //得到要发送的服务器 unset($data['post_data']['server_ids']); //删除掉这些玩家,一会好发送post数据给游戏接口 $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object'); $this->_utilApiFrg->curlInit(); $getArr = unserialize($data['send_action']); foreach ($serverIds as $serverId) { $this->_utilApiFrg->addHttp($serverId, $getArr, $data['post_data']); } $this->_utilApiFrg->send(); $sendResult = array(); $result = $this->_utilApiFrg->getResults(); foreach ($result as $key => $backParams) { $color = $backParams['msgno'] == 1 ? '#00CC00' : '#ff0000'; //定义颜色 $message = $backParams['msgno'] == 1 ? '发送成功' : '发送失败'; $backParams['message'] = $backParams['message'] ? $backParams['message'] : $message; if ($backParams) { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; array_push($sendResult, $string); } else { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; array_push($sendResult, $string); } } $retStr = implode('<br>', $sendResult); $this->update(array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => $retStr), "Id={$id}"); $this->_utilApiFrg = null; return $retStr; case '12': //生成金币卡 $this->_modelGoldCard = $this->_getGlobalData('Model_GoldCard', 'object'); $data = $this->_modelGoldCard->import(unserialize($data['post_data'])); if ($data['status'] == 1) { $updateArr = array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => "Id:{$id} <font color='#00CC00'>生成金币卡成功</font>"); $this->update($updateArr, "Id={$id}"); return '<font color="#00CC00">' . $data['msg'] . '</font>'; } return '<font color="#FF0000">生成金币卡失败</font>'; } } else { $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($data['server_id']); $this->_utilFRGInterface->setGet(unserialize($data['send_action'])); $this->_utilFRGInterface->setPost(unserialize($data['post_data'])); $backParams = $this->_utilFRGInterface->callInterface(); $this->_utilFRGInterface = null; $color = $backParams['msgno'] == 1 ? '#00CC00' : '#ff0000'; //定义颜色 if ($backParams['msgno'] == 1) { $updateArr = array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => $this->_createAcceptMsg($data['type'], $backParams, "Id:{$id} <font color='{$color}'>{$backParams['message']}</font>")); $this->update($updateArr, "Id={$id}"); } return $this->_createAcceptMsg($data['type'], $backParams, "Id:{$id} <font color='{$color}'>{$backParams['message']}</font>"); } } return "无此记录Id : {$id}"; }
/** * 手动录入工单 */ public function actionManualEntry() { $gameTypes = $this->_getGlobalData('game_type'); $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name'); $operators = $this->_getGlobalData('operator_list'); $operators = Model::getTtwoArrConvertOneArr($operators, 'Id', 'operator_name'); $this->_modelQuestionType = $this->_getGlobalData('Model_QuestionType', 'Object'); $questionType = $this->_modelQuestionType->getGameQuestionType(); if ($this->_isPost()) { $_POST['game_type_id'] = intval($_POST['game_type_id']); $sendData['question_type'] = intval($_POST['questionType']); $sendData['game_user_id'] = intval($_POST['UserId']); //有些游戏可能要重新double($_POST['UserId']) $sendData['title'] = trim($_POST['title']); $sendData['content'] = $_POST['content']; if (!$sendData['question_type']) { $this->_utilMsg->showMsg('标题类型错误', -1); } if (!$sendData['game_user_id']) { $this->_utilMsg->showMsg('用户ID不能为空', -1); } if (!$sendData['title']) { $this->_utilMsg->showMsg('标题不能为空', -1); } if (!trim($sendData['content'])) { $this->_utilMsg->showMsg('内容不能为空', -1); } $sendOk = false; $errorInfo = Tools::getLang('SEND_MSG', __CLASS__); switch ($_POST['game_type_id']) { case 1: $gameServerList = $this->_getGlobalData('server/server_list_' . $_POST['game_type_id']); $gameServerUrl = $gameServerList[$_POST['server_id']]['server_url']; $this->_utilApiBto = $this->_getGlobalData('Util_ApiBto', 'object'); $sendUrl = $gameServerUrl . 'api_interface.php?action=FaqService&doaction=GetUserQuiz'; $this->_utilApiBto->addHttp($sendUrl, null, $sendData); $this->_utilApiBto->send(); $dataResult = $this->_utilApiBto->getResult(); //"$dataResult" = Array [3] // status = (int) 1 // info = (string:55) Submitted! Please wait for reply from CS with patience! // data = Array [8] // order_id = (int) 17 // user_id = (int) 1002 // user_account = (string:10) uwan188110 // user_nickname = (string:6) sdfsfs // money_month = (int) 390299 // money_total = (int) 570299 // register_date = (string:10) 1282743121 // server_marking = (string:6) S10009 if ($dataResult['status'] == 1) { $sendOk = true; } else { $errorInfo = $dataResult['info']; } break; case 2: $gameServerList = $this->_getGlobalData('server/server_list_' . $_POST['game_type_id']); $sendUrl = $gameServerList[$_POST['server_id']]['server_url']; $sendUrl .= 'php/interface.php?m=clerk&c=UserQuiz&a=SubmitByCs'; $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->set_sendUrl($sendUrl); $sendData['_sign'] = md5(TAKE_KEY . CURRENT_TIME); $sendData['_verifycode'] = CURRENT_TIME; $this->_utilFRGInterface->setPost($sendData); $dataResult = $this->_utilFRGInterface->callInterface(); //"$dataResult" = Array [5] // msgno = (int) 0 // message = (string:0) // backurl = (string:0) // data = Array [3] // status = (int) 1 // info = (string:0) // data = Array [1] // order_id = (int) 64125 // backparams = (string:0) if ($dataResult['data']['status'] == 1) { $sendOk = 1; } else { $errorInfo = $dataResult['message']; } break; case 3: $gameServerList = $this->_getGlobalData('server/server_list_' . $_POST['game_type_id']); $gameServerUrl = $gameServerList[$_POST['server_id']]['server_url']; $utilHttpMInterface = $this->_getGlobalData('Util_HttpMInterface', 'object'); $sendData['userId'] = $sendData['game_user_id']; $sendData['questionType'] = $sendData['question_type']; unset($sendData['game_user_id'], $sendData['question_type']); $sendData['source'] = 3; $utilHttpMInterface->addHttp($gameServerUrl, 'question/saveQuestion', array(), $sendData); $utilHttpMInterface->send(); $data = $utilHttpMInterface->getResults(); $data = json_decode(array_shift($data), true); if ($data && $data['r'] === 0) { $sendOk = true; } //"$data" = Array [2] // r = (int) 0 // m = Array [1] // order_id = (int) 64113 break; case 4: $this->_utilMsg->showMsg('暂未开放', -1); break; case 5: $this->_utilMsg->showMsg('暂未开放', -1); break; case 6: $this->_utilMsg->showMsg('暂未开放', -1); break; case 7: $this->_utilMsg->showMsg('暂未开放', -1); break; default: $this->_utilMsg->showMsg('游戏选择错误', -1); } if ($sendOk) { $this->_utilMsg->showMsg('操作成功', 1); } else { $this->_utilMsg->showMsg($errorInfo, -1); } } else { $this->_modelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object'); $servers = $this->_modelGameOperator->getGmOptSev(); $this->_view->assign('gameTypes', json_encode($gameTypes)); $this->_view->assign('operators', json_encode($operators)); $this->_view->assign('servers', json_encode($servers)); $this->_view->assign('questionType', json_encode($questionType)); $this->_utilMsg->createNavBar(); $this->_view->display(); } }