/** * 生成卡号 */ 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=" . self::GAME_ID . " and batch_num='{$batchNum}'", 1)) { $this->_utilMsg->showMsg(Tools::getLang('CARD_BATCHCLASH', __CLASS__), -1, 2); } $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object'); $gameClass = $this->_getGlobalData(self::GAME_ID, 'game'); $apply_info = "申请原因<br>{$_POST['cause']}<br>" . $gameClass->AddAutoCause($_POST, 12); //1的类型是奖励发送 $userClass = $this->_utilRbac->getUserClass(); $applyData = array('type' => self::APPLY_TPYE_GOLD, 'server_id' => 0, 'operator_id' => intval($_POST['operator_id']), 'game_type' => self::GAME_ID, 'list_type' => 3, 'apply_info' => $apply_info, 'send_type' => 1, 'send_data' => array('data' => array('card_type' => intval($_POST['card_type']), 'operator_id' => intval($_POST['operator_id']), 'batch_num' => trim($_POST['batch_num']), 'gold' => intval($_POST['gold']), 'num' => intval($_POST['num']), 'is_time' => intval($_POST['is_time']), 'start_time' => trim($_POST['start_time']), 'end_time' => trim($_POST['end_time']), 'apply_user_id' => $userClass['_id'], 'game_type' => self::GAME_ID), 'call' => array('cal_local_object' => 'Model_GoldCard', 'cal_local_method' => 'import', 'params' => NULL)), 'receiver_object' => NULL, 'player_type' => 0, 'player_info' => NULL); $_modelApply = $this->_getGlobalData('Model_Apply', 'object'); $applyInfo = $_modelApply->AddApply($applyData); if (true === $applyInfo) { $URL_CsAll = Tools::url('Apply', 'GoldAll'); $showMsg = '申请成功,等待审核...<br>'; $showMsg .= "<a href='{$URL_CsAll}'>金币审核列表(全部)</a>"; $this->_utilMsg->showMsg($showMsg, 1, 1, false); } else { $this->_utilMsg->showMsg($applyInfo['info'], -1, 1, false); } } else { if ($_GET['card_type']) { $this->_view->set_tpl(array('body' => self::PACKAGE . '/' . self::GOLD . "/CardAdd{$_GET['card_type']}.html")); } else { $this->_view->set_tpl(array('body' => self::PACKAGE . '/' . self::GOLD . '/CardAdd.html')); } $this->_utilMsg->createPackageNavBar(); $this->_view->display(); } }
/** * 生成卡号 */ 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(); } }