public function actionIndex()
 {
     $users = $this->_getGlobalData('user_index_id');
     if ($this->_isPost()) {
         $auditType = $this->_getGlobalData('frg_audit_type');
         array_unshift($auditType, '汇总');
         if (empty($_POST['start_date']) || empty($_POST['end_date'])) {
             $this->_utilMsg->showMsg('请设置开始时间与结束时间', -1, 2);
         }
         if ($_POST['audit_user_id']) {
             $auditUserId = Tools::coerceInt($_POST['audit_user_id']);
         }
         $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
         $time = array('start' => strtotime($_POST['start_date']), 'end' => strtotime($_POST['end_date']));
         $dataList = $this->_modelApplyDataFrg->stats($time, $auditUserId);
         $this->_view->assign('dataList', $dataList);
         $this->_view->assign('displayTrue', true);
         $this->_view->assign('auditType', $auditType);
     }
     $this->_view->assign('users', $users);
     $this->_utilMsg->createPackageNavBar();
     $this->_view->display();
 }
Exemple #2
0
 /**
  * 生成卡号
  */
 public function actionCardAdd()
 {
     $this->_checkOperatorAct(true);
     //null : 检测$_SERVER['id'],true : 检测$_REQUEST['operator_id']
     if ($this->_isPost()) {
         //检查所在游戏是否有相同批号
         $this->_modelGoldCard = $this->_getGlobalData('Model_GoldCard', 'object');
         $batchNum = md5($_POST['batch_num']);
         if ($this->_modelGoldCard->select("select Id from {$this->_modelGoldCard->tName()} where game_type={$this->game_id} and batch_num='{$batchNum}'", 1)) {
             $this->_utilMsg->showMsg(Tools::getLang('CARD_BATCHCLASH', __CLASS__), -1, 2);
         }
         $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
         $postArr = array();
         $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
         $userClass = $this->_utilRbac->getUserClass();
         $_POST['apply_user_id'] = $userClass['_id'];
         $postArr['type'] = 12;
         //金币卡号生成
         $postArr['cause'] = $_POST['cause'];
         unset($_POST['cause']);
         $postArr['send_action'] = '0';
         $_POST['game_type'] = $this->game_id;
         //在表中增加游戏ID,富人国game_id是2
         $postArr['post_data'] = $_POST;
         $this->_modelApplyDataFrg->set_postArr($postArr);
         $data = $this->_modelApplyDataFrg->add();
         $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']);
     } else {
         if ($_GET['card_type']) {
             $this->_view->set_tpl(array('body' => "FrgGold/CardAdd{$_GET['card_type']}.html"));
         } else {
             $this->_view->set_tpl(array('body' => 'FrgGold/CardAdd.html'));
         }
         $this->_utilMsg->createNavBar();
         $this->_view->display();
     }
 }
 /**
  * 生成礼包卡号
  */
 public function actionAddCard()
 {
     if ($_REQUEST['server_id'] && $this->_isPost()) {
         $sendParams = Tools::getFilterRequestParam();
         $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
         $postArr = array();
         $postArr['server_id'] = $_POST['server_id'];
         $postArr['type'] = 7;
         //礼包生成卡号
         $postArr['cause'] = $_POST['cause'];
         unset($_POST['cause']);
         $postArr['send_action'] = array('c' => 'Card', 'a' => 'Create', 'doaction' => 'save');
         $postArr['post_data'] = $_POST;
         $this->_modelApplyDataFrg->set_postArr($postArr);
         $data = $this->_modelApplyDataFrg->add();
         $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href'], false);
     } else {
         $this->_createServerList();
         $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object');
         $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']);
         $sendParams = Tools::getFilterRequestParam();
         $this->_utilFRGInterface->setGet(array('c' => 'Card', 'a' => 'Create'));
         $this->_utilFRGInterface->setPost($sendParams);
         $data = $this->_utilFRGInterface->callInterface();
         if ($data['data']['TypeData']) {
             $this->_view->assign('cardList', json_encode($data['data']['TypeData']));
         }
         //卡类型
         $this->_view->assign('systemTime', $data['data']['SYSTEM_TIME']);
         if ($_GET['Id'] && $_GET['card_name']) {
             $this->_view->assign('selectedLibao', array('Id' => $_GET['Id'], 'card_name' => $_GET['card_name']));
         }
         $this->_utilMsg->createNavBar();
         $this->_view->display();
     }
 }
 /**
  * 多服务器玩家即时发放道具
  */
 public function actionRewardBefore()
 {
     if ($this->_isPost() && $_POST['submit']) {
         unset($_POST['submit']);
         $_POST['ToolId'] = $_POST['Tool'];
         $_POST['ToolIdName'] = $_POST['ToolName'];
         $_POST['ToolIdImg'] = $_POST['ToolImg'];
         unset($_POST['Tool'], $_POST['ToolName'], $_POST['ToolImg']);
         $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataBTO2', 'object');
         $postArr = array();
         $postArr['server_id'] = $_POST['server_id'];
         unset($_POST['server_id']);
         $postArr['type'] = 10;
         //'批量多玩家奖励发放'
         $postArr['cause'] = $_POST['cause'];
         unset($_POST['cause']);
         $postArr['send_action'] = array('c' => 'Reward', 'a' => 'SendAward', 'Action' => 'Save');
         $postArr['post_data'] = $_POST;
         $this->_modelApplyDataFrg->set_postArr($postArr);
         $data = $this->_modelApplyDataFrg->add();
         $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href'], false);
     } else {
         if (!count($_POST['ids'])) {
             $this->_utilMsg->showMsg(Tools::getLang('PLZ_SLT_USER', 'Common'), 1, -1);
         }
         if ($_POST['player_type'] == '') {
             $this->_utilMsg->showMsg(Tools::getLang('PARAMETER_ERROT', 'Common'), 1, -1);
         }
         $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object');
         $this->_utilFRGInterface->setServerUrl($this->_defaultServerId);
         //初始化连接url地址
         $this->_utilFRGInterface->setGet(array('c' => 'Reward', 'a' => 'SendAward'));
         $data = $this->_utilFRGInterface->callInterface();
         if ($data) {
             $this->_view->assign('toolData', json_encode($data['data']['ToolData']));
             $effData = $data['data']['ObjProp'];
             $newEffData = array();
             foreach ($effData as $key => $value) {
                 $newEffData[$key] = array();
                 foreach ($value as $childValue) {
                     $newEffData[$key][$childValue]['Key'] = "{$key}.{$childValue}";
                     $newEffData[$key][$childValue]['Name'] = $data['data']['ObjData'][$key][$childValue]['Name'];
                 }
             }
             $this->_view->assign('effData', json_encode($newEffData));
         } else {
             $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -1);
         }
         $serverList = $this->_getGlobalData('gameser_list');
         $playerIds = array();
         foreach ($_POST['ids'] as $id) {
             $playerIds[$_POST['server_id'][$id]][] = $_POST['player_id'][$id];
         }
         foreach ($playerIds as &$serverPlayers) {
             $serverPlayers = array_unique($serverPlayers);
         }
         $this->_view->assign('playerIds', $playerIds);
         $this->_view->assign('serverList', $serverList);
         $this->_view->assign('serializePlayerIds', serialize($playerIds));
         $this->_utilMsg->createNavBar();
         $this->_view->display();
     }
 }
 /**
  * 架座数值修改
  */
 public function actionUserCarTune()
 {
     $this->_createServerList();
     if ($_REQUEST['server_id']) {
         if ($_POST['user_edit']) {
             //改变玩家信息
             $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
             $postArr = array();
             $postArr['server_id'] = $_POST['server_id'];
             unset($_POST['server_id']);
             $postArr['type'] = 5;
             //员工数值修改
             $postArr['cause'] = $_POST['cause'];
             unset($_POST['cause']);
             $postArr['send_action'] = array('c' => 'UserData', 'a' => 'CarTune', 'doaction' => 'save');
             $postArr['post_data'] = $_POST;
             $this->_modelApplyDataFrg->set_postArr($postArr);
             $data = $this->_modelApplyDataFrg->add();
             $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href'], false);
         } elseif ($_POST['addtool']) {
             //增加座驾道具
             $sendParams = Tools::getFilterRequestParam();
             $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object');
             $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']);
             $sendParams = Tools::getFilterRequestParam();
             $this->_utilFRGInterface->setGet(array('c' => 'UserData', 'a' => 'CarTune', 'doaction' => 'addtool'));
             $this->_utilFRGInterface->setPost($sendParams);
             $data = $this->_utilFRGInterface->callInterface();
             if ($data) {
                 if ($data['msgno'] == 1) {
                     $this->_utilMsg->showMsg($data['message'], 1, 2);
                 } else {
                     $this->_utilMsg->showMsg($data['message'], -2, 2);
                 }
             } else {
                 $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -1);
             }
         } elseif ($_POST['search_user'] || $_GET['request'] == 'read') {
             //搜索玩家信息
             if ($_GET['request'] == 'read') {
                 //如果为只读消息的话,表示察 看
                 $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
                 $auditData = $this->_modelApplyDataFrg->findById($_GET['audit_id']);
                 $auditData['post_data'] = unserialize($auditData['post_data']);
                 $_POST['userflag'] = 'txtids';
                 $_POST['txtids'] = $auditData['post_data']['userid'];
                 $this->_view->assign('auditData', $auditData);
                 $this->_view->assign('postData', $auditData['post_data']);
                 $this->_view->assign('read', true);
             }
             $sendParams = Tools::getFilterRequestParam();
             $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object');
             $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']);
             $this->_utilFRGInterface->setGet(array('c' => 'UserData', 'a' => 'CarTune', 'doaction' => 'query'));
             $this->_utilFRGInterface->setPost($sendParams);
             $data = $this->_utilFRGInterface->callInterface();
             if ($data) {
                 if ($data['data']['ErrMsg'][0]) {
                     //如果没有记录
                     $this->_view->assign('errMsg', $data['data']['ErrMsg'][0]);
                 } else {
                     //如果有
                     $this->_view->assign('detailTrue', true);
                     //显示详细
                     $this->_view->assign('uo', $data['data']['uo']);
                     $this->_view->assign('car', $data['data']['Car']);
                     $selectTools = $data['data']['Tools'];
                     $selectTools = Model::getTtwoArrConvertOneArr($selectTools, 'Id', 'toolsname');
                     $this->_view->assign('selectTools', $selectTools);
                 }
             } else {
                 $this->_utilMsg->showMsg(Tools::getLang('CONNECT_SERVER_ERROR', 'Common'), -1);
             }
         }
     }
     $this->_utilMsg->createPackageNavBar();
     $this->_view->display();
 }
Exemple #6
0
 /**
  * 显示页面
  * @param 可显示的参数 $options
  */
 private function _view($options, $apply_id_of_mine = 0, $myOperator = array())
 {
     $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
     $auditType = $this->_getGlobalData('frg_audit_type');
     foreach ($auditType as $key => &$value) {
         if (!in_array($key, $options)) {
             unset($auditType[$key]);
         }
     }
     $user = $this->_getGlobalData('user');
     $this->_loadCore('Help_SqlSearch');
     $this->_loadCore('Help_Page');
     $gameServerList = $this->_getGlobalData('gameser_list');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelApplyDataFrg->tName());
     if ($myOperator) {
         $myOperator = implode(',', $myOperator);
         if (strpos($myOperator, ',')) {
             $helpSqlSearch->set_conditions("operator_id in ({$myOperator})");
         } else {
             $helpSqlSearch->set_conditions("operator_id={$myOperator}");
         }
     }
     if ($_GET['type'] && in_array($_GET['type'], $options)) {
         $helpSqlSearch->set_conditions("type={$_GET['type']}");
         $this->_view->assign('selectedType', $_GET['type']);
     } else {
         $helpSqlSearch->set_conditions("type in (" . implode(',', $options) . ")");
     }
     if ($_GET['send'] != '') {
         $helpSqlSearch->set_conditions("is_send={$_GET['send']}");
         $this->_view->assign('selectedSend', $_GET['send']);
     }
     if ($_GET['audit_user_id']) {
         $helpSqlSearch->set_conditions("audit_user_id='{$_GET['audit_user_id']}'");
         $this->_view->assign('selectedAuditUserId', $_GET['audit_user_id']);
     }
     if ($_GET['apply_user_id']) {
         $helpSqlSearch->set_conditions("apply_user_id='{$_GET['apply_user_id']}'");
         $this->_view->assign('selectedApplyUserId', $_GET['apply_user_id']);
     } elseif ($apply_id_of_mine > 0) {
         $helpSqlSearch->set_conditions("apply_user_id='{$apply_id_of_mine}'");
         $this->_view->assign('selectedApplyUserId', $apply_id_of_mine);
     }
     //搜索玩家
     if ($_GET['user_info'] != '') {
         $helpSqlSearch->set_conditions("user_info Like '%{$_GET['user_info']}%'");
         $this->_view->assign('user_info', $_GET['user_info']);
     }
     $helpSqlSearch->set_orderBy('is_send asc , create_time desc');
     if (!$_POST['xls']) {
         $helpSqlSearch->setPageLimit($_GET['page'], 10);
     }
     //如果为引出excel
     $conditions = $helpSqlSearch->get_conditions();
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelApplyDataFrg->select($sql);
     Tools::import('Util_FontColor');
     if ($dataList) {
         foreach ($dataList as $key => &$list) {
             if (!in_array($list['type'], $options)) {
                 unset($dataList[$key]);
             }
             //如果不是在选项中的,就unset掉
             $list['word_type'] = Util_FontColor::getFRGauditType($list['type'], $auditType[$list['type']]);
             $list['word_apply_user_id'] = $user[$list['apply_user_id']]['nick_name'];
             $list['word_audit_user_id'] = $user[$list['audit_user_id']]['nick_name'];
             $list['send_action'] = unserialize($list['send_action']);
             $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
             $list['word_is_send'] = Util_FontColor::getFRGsendType($list['is_send']);
             $list['word_server_id'] = $list['server_id'] ? $gameServerList[$list['server_id']]['full_name'] : Tools::getLang('AUDIT_MANYSERVER', __CLASS__);
             $list['url_view'] = $this->_createAuditDetailUrl($list);
             $list['send_time'] = $list['send_time'] ? date('Y-m-d H:i:s', $list['send_time']) : '';
             $list['cause'] = stripcslashes($list['cause']);
             $list['audit_ip'] = $list['audit_ip'] ? long2ip($list['audit_ip']) : '';
             $list['apply_ip'] = $list['apply_ip'] ? long2ip($list['apply_ip']) : '';
         }
         $this->_view->assign('dataList', $dataList);
         $helpPage = new Help_Page(array('total' => $this->_modelApplyDataFrg->findCount($conditions), 'prepage' => 10));
         $this->_view->assign('pageBox', $helpPage->show());
     }
     $auditType[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('auditType', $auditType);
     $sendType = Util_FontColor::$frgSendString;
     $sendType[''] = Tools::getLang('ALL', 'Common');
     $this->_view->assign('sendType', $sendType);
     $users = Model::getTtwoArrConvertOneArr($user, 'Id', 'full_name');
     $this->_view->assign('users', $users);
     if ($apply_id_of_mine > 0) {
         $this->_view->set_tpl(array('body' => 'FrgAudit/MyApplication.html'));
     } else {
         $this->_view->set_tpl(array('body' => 'FrgAudit/Audit.html'));
     }
     $this->_utilMsg->createNavBar();
     if ($_GET['xls']) {
         Tools::import('Util_ExportExcel');
         $this->_utilExportExcel = new Util_ExportExcel(Tools::getLang('AUDIT_EXCELNAME', __CLASS__), 'Excel/FrgAudit', $dataList);
         $this->_utilExportExcel->outPutExcel();
     } else {
         $this->_view->display();
     }
 }