public function __construct() { //全局载入的class文件 Tools::import('Object_UserInfo'); $this->_utilMsg = $this->_getGlobalData('Util_Msg', 'object'); $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); }
/** * 获取全局变量,注:如果获取对象不存在,将注册对象,以后在次获取都将会是同一对象,单例模式. * @param key $key * @param string $type 注册全局类型,可以是object,cache(默认),room,user * @return object,cache,string,int */ protected static function _getGlobalData($key, $type = 'cache') { $type = strtolower($type); if (!isset(self::$_global[$type][$key])) { //如果没有的话... switch ($type) { case 'object': Tools::import($key); self::$_global[$type][$key] = new $key(); break; case 'room': //房间对象 $key为数据库里的Id self::$_global[$type][$key] = self::_includeFile(ROOMS_DIR . "/{$key}.serialize.php"); self::$_global[$type][$key] = unserialize(self::$_global[$type][$key]); break; case 'user': //用户对象 $key为用户名 self::$_global[$type][$key] = self::_includeFile(USERS_DIR . "/{$key}/Info.serialize.php"); self::$_global[$type][$key] = unserialize(self::$_global[$type][$key]); break; default: self::$_global[$type][$key] = self::_includeFile(CACHE_DIR . "/{$key}.cache.php"); } } return self::$_global[$type][$key]; }
/** * 返回邮件列表 * @param array $limit * @param int $type */ public function getMail($limit, $where) { $this->_loadCore('Help_Page'); $this->_loadCore('Help_SqlSearch'); $this->_modelUserMail = $this->_getGlobalData('Model_UserMail', 'object'); $helpSqlSearch = new Help_SqlSearch(); $helpSqlSearch->set_tableName($this->_modelUserMail->tName()); $helpSqlSearch->set_conditions("user_id={$this->_id}"); if ($where !== null) { foreach ($where as $key => $value) { $helpSqlSearch->set_conditions("{$key}='{$value}'"); } } $helpSqlSearch->set_orderBy('create_time desc'); $helpSqlSearch->setPageLimit($limit[0], $limit[1]); $conditions = $helpSqlSearch->get_conditions(); $sql = $helpSqlSearch->createSql(); $dataList = $this->_modelUserMail->select($sql); if (count($dataList)) { Tools::import('Util_FontColor'); foreach ($dataList as &$list) { $list['word_is_read'] = Util_FontColor::getMailRead($list['is_read']); if ($list['href']) { $list['title'] = "<a href='javascript:void(0)' is_read='{$list['is_read']}' url='{$list['href']}' cur_id='{$list['Id']}' onclick='readMail(\$(this))'>{$list['title']}</a>"; } else { $list['title'] = "<a href='javascript:void(0)' is_read='{$list['is_read']}' cur_id='{$list['Id']}' onclick='readMail(\$(this))'>{$list['title']}</a>"; } } $helpPage = new Help_Page(array('total' => $this->_modelUserMail->findCount($conditions), 'perpage' => $limit[1])); $pageBox = $helpPage->show(); return array('data' => $dataList, 'pageBox' => $pageBox); } else { return false; } }
public function __construct() { parent::__construct(); Tools::import('Model.User'); Tools::import('Util.Msg'); $this->_mUser = new Model_User(); $this->_uMsg = Util_Msg::returnInstance(); }
/** * 检测是否满足点单条件 */ private function _checkOrderCondition() { Tools::import('Model.User'); $user = new Model_User(); if (!$user->isSelectTable()) { Tools::alertMsg($this->_uMsg->errorPrompt[011], Tools::url('Default', 'Index')); } }
/** * 事件纷发 */ private function _dispatch() { Tools::import($this->_account[$this->_curUnion]['class']); $obj = new $this->_account[$this->_curUnion]['class'](); $action = $this->_curAction; $msg = $obj->{$action}(); $this->_returnAjaxJson($msg); }
public function __construct() { $this->_createView(); $this->_createUrl(); Tools::import('Model_Act'); $this->_modelAct = new Model_Act(); Tools::import('Util_Msg'); $this->_utilMsg = new Util_Msg(); $this->_loadCore('Help_SqlSearch'); $this->_helpSqlSearch = new Help_SqlSearch(); }
/** * 生成act文件 */ public function createAct() { Tools::import('Model_Act'); $modelAct = new Model_Act(); $dataList = $modelAct->findAll(); $actArr = array(); foreach ($dataList as $value) { $actArr[$value['value']] = $value['allow']; } return $this->_addCache($actArr, $this->_cacheFile); }
public static function returnInstance() { switch ($_SESSION['lang']) { case 'en': Tools::import('Lang.EnLanguage'); return Lang_EnLanguage::instance(); break; case 'lv': Tools::import('Lang.LvLanguage'); return Lang_LvLanguage::instance(); break; case 'cn': Tools::import('Lang.CnLanguage'); return Lang_CnLanguage::instance(); break; default: Tools::import('Lang.CnLanguage'); return Lang_CnLanguage::instance(); break; } }
/** * 充值礼包管理 */ 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(); } }
<?php Tools::import('Control_BaseGm'); class Control_Game extends BaseGm { private $_modelGame; public function __construct() { $this->_createView(); $this->_modelGame = $this->_getGlobalData('Model_Game', 'object'); } public function actionGameList() { //<<表单参数 $page = $_GET['page']; $Id = $_GET['Id']; $name = $_GET['name']; $ename = $_GET['ename']; $uwan_game_id = $_GET['uwan_game_id']; $is_list = $_GET['is_list']; //>>表单参数 $data = $this->_modelGame->gameList($page, $Id, $name, $ename, $uwan_game_id, $is_list); $this->_view->assign('dataList', $data['list']); $this->_loadCore('Help_Page'); //载入分页工具 $helpPage = new Help_Page(array('total' => $data['page']['total'], 'perpage' => $data['page']['pageSize'])); $this->_view->assign('pageBox', $helpPage->show()); $isList = array('' => '-全部-', 1 => '使用公共模块', 0 => '使用独立模板'); $this->_view->assign('is_list', $isList); $this->_view->display(); }
public function __construct() { Tools::import('Object_OrderManage'); }
/** * 按小时统计详细_ajax */ public function actionHourDetail() { Tools::import('Util_Stats'); $utilStats = new Util_Stats(Util_Stats::STATS_OPERATOR); $key = $_POST['detail_key']; $time = array(); $time['start'] = strtotime($_POST['start_date']); $time['end'] = strtotime($_POST['end_date']); $utilStats->setStatsTime($time); $utilStats->setOperator(array('game_type_id' => $_POST['game_type_id'], 'operator' => $_POST['operator_id'])); $utilStats->setHour($key); $dataList = $utilStats->stats(); $this->_view->assign('dataList', $dataList); $tableTitle = $utilStats->getTableTitle($_POST['game_type_id']); $tableTitle['time'] = $time; $this->_view->assign('tableTitle', $tableTitle); $this->_view->display('Stats/StatsOperator/OperatorDetail'); }
public function __construct() { $this->_modelRooms = $this->_getGlobalData('Model_Rooms', 'object'); Tools::import('Object_Room'); }
/** * 返回用户邮件对象,单例模式 * @return Object_UserMail */ public function getUserMail() { if (!$this->_mail) { Tools::import('Object_UserMail', 'object'); $this->_mail = $this->_includeFile(USERS_DIR . "/{$this->_userName}/Mail.serialize.php"); $this->_mail = unserialize($this->_mail); } return $this->_mail; }
public function actionClearOrder() { Tools::import('Util_WorkOrder'); $utilWorkOrder = new Util_WorkOrder(); $orderManage = $utilWorkOrder->getOrderManage(); $orderManage['_workOrder'] = array(); $orderManage->setUpdateInfo(1); }
/** * 提交点单页面 */ public function SubmitFormAction() { Tools::import('Model.RemarkOrder'); $remarkOrder = new Model_RemarkOrder(); $time = time(); $staffno = $_SESSION['account']['user']; $customize = $_SESSION['table_num']; $tableName = $this->_mSendorder->tName(); try { for ($i = 0; $i < count($_POST['item_no']); $i++) { $updateArr = array('staffno' => $staffno, 'customize' => $customize, 'site_no' => strval($_POST['site_no'][$i]), 'item_no' => strval($_POST['item_no'][$i]), 'qty' => strval($_POST['num'][$i]), 'input_time' => date('Y-m-d H:i:s', $time)); $this->_mSendorder->add($tableName, $updateArr); //如果有配菜,将配菜插入表里 if ($_SESSION['menu'][$updateArr['site_no']][$updateArr['item_no']]['remark']) { $remarkArr = $_SESSION['menu'][$updateArr['site_no']][$updateArr['item_no']]['remark']; $inputTime = date('Y-m-d H:i:s', $time); foreach ($remarkArr as $list) { $list['input_time'] = $inputTime; $remarkOrder->add($remarkOrder->tName(), $list); } } } unset($_SESSION['menu']); unset($_SESSION['table_num']); unset($_SESSION['placeNum']); Tools::alertMsg($this->_uMsg->sucessPrompt[010], Tools::url('Default', 'Table')); } catch (Exception $e) { echo $e->getMessage(); } }
<?php /** * 公共GM后台 * @author PHP-兴源 */ Tools::import('Control_BaseZp'); abstract class ActionGame extends BaseZp { function __construct() { parent::__construct(); if (ACTION == 'Moudle') { return; //当设置权限时,放行 } $this->package = 'ActionGame'; $this->_view->set_tpl_dir('actionTheme'); //改掉模板目录(主题) $this->game_id = intval($_REQUEST['__game_id']); //从接口中获取game_id if (!$this->game_id) { $this->_returnAjaxJson(array('status' => 0, 'info' => 'game id error', 'data' => NULL)); } //这个迟点可以优化到搬到game类调用 // $this->_gameIfConf = $this->_getGlobalData('game_if_conf/'.$this->game_id); $gameObject = $this->_getGlobalData($this->game_id, 'game'); $this->_gameIfConf = $gameObject->getIfConf(); if (!$this->_gameIfConf[ACTION]['action']) { $this->_returnAjaxJson(array('status' => 0, 'info' => 'game interface not found', 'data' => NULL)); }
<?php Tools::import('Game_GameBase'); class Game_16 extends Game_GameBase { /** * 初始化 */ public function _init() { $this->_gameId = 16; $this->_sendImage = true; $this->_key = "5dcd73d391c90e8769618d42a916ea3c"; } public function workOrderIfChk() { if (CONTROL == 'InterfaceFaq') { return true; } return $this->clientChk($this->_key); } public function clientChk($_key) { $gameId = intval($_REQUEST['game_id']); $uniquePlayer = trim($_REQUEST['_unique']); if (empty($_key)) { $key = $this->_key; } else { $key = $_key; } $sign = trim($_REQUEST['_sign']);
<?php Tools::import('Util_Curl'); /** * 富人国新api接口,用于解决并发问题 * @author php-朱磊 * */ class Util_ApiFrg extends Util_Curl { const ENCRYPT_KEY = 'kdfndsfasdrn@#$b'; //加密密钥 const USER_NAME = 'client'; //账号 const PASSWORD = '******'; //密码 const SUPER_LOGIN_KEY = 'uY*$&n-87N'; //超级密码 const ENCODE_RPCSERI = 'RpcSeri'; //传输方式 序列化 const ENCODE_AJAX = 'AjaxTran'; //传输方式 json const ENCODE_HTML = 'HtmlTemplate'; //返回html页面 private $_encodeType = 'RpcSeri'; private static $_autoKey = 0; public function __construct() { parent::__construct(); } public function setEncodeType($enCode)
<?php Tools::import('Control_Interface'); /** * 后台工单工单webservice接口 * @author php-朱磊 */ class Control_InterfaceWorkOrder extends ApiInterface { /** * Util_Rbac * @var Util_Rbac */ private $_utilRbac; /** * Model_WorkOrder * @var Model_WorkOrder */ private $_modelWorkOrder; /** * Model_GameSerList * @var Model_GameSerList */ private $_modelGameSerList; /** * Model_WorkOrderDetail * @var Model_WorkOrderDetail */ private $_modelWorkOrderDetail; /** * Model_WorkOrderQa
/** * 投票 */ private function _voteIndex() { $this->_loadCore('Help_SqlSearch'); $this->_loadCore('Help_Page'); $users = $this->_getGlobalData('user'); $this->_modelVote = $this->_getGlobalData('Model_Vote', 'object'); $helpSqlSearch = new Help_SqlSearch(); $helpSqlSearch->set_tableName($this->_modelVote->tName()); $helpSqlSearch->set_orderBy('start_time desc,end_time desc'); $helpSqlSearch->setPageLimit($_GET['page']); $sql = $helpSqlSearch->createSql(); $dataList = $this->_modelVote->select($sql); if ($dataList) { $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); $userClass = $this->_utilRbac->getUserClass(); Tools::import('Util_FontColor'); foreach ($dataList as &$list) { $list['word_user_id'] = $users[$list['user_id']]['nick_name']; $list['word_is_open'] = Util_FontColor::getVoteOpen($list['is_open']); $list['start_time'] = date('Y-m-d H:i:s', $list['start_time']); $list['end_time'] = date('Y-m-d H:i:s', $list['end_time']); $list['my_status'] = $this->_modelVote->getUserStatus($userClass['_id'], unserialize($list['vote_user'])); $list['word_my_status'] = Util_FontColor::getVoteUserStatus($list['my_status']); $list['url_show'] = Tools::url(CONTROL, 'Vote', array('Id' => $list['Id'], 'doaction' => 'show')); } $this->_view->assign('dataList', $dataList); $helpPage = new Help_Page(array('total' => $this->_modelVote->findCount(), 'prepage' => PAGE_SIZE)); $this->_view->assign('pageBox', $helpPage->show()); } $this->_view->set_tpl(array('body' => 'ServiceTools/Vote.html')); $this->_utilMsg->createNavBar(); $this->_view->display(); }
/** * 选择了游戏,提交了问题名称之后进入的页面 */ public function actionAsk() { if ($this->_isPost()) { $gameTypeList = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name'); $question = $this->_modelQuestionType->findById($_POST['question_type']); //查找ID对应的问题 Tools::import('Util_QuickForm'); $quickForm = new Util_QuickForm(); $quickForm->set_selectedGameType($_POST['game_type']); //设置用户提交过来的游戏类型,方便调用服务器列表 $quickForm->addManyElementArray($question['form_table']); $this->_view->assign('questionHtml', $quickForm->get_formHtml()); $this->_view->assign('questionTitle', $question['title']); //获取问题标题 $this->_view->assign('gameType', $_POST['game_type']); $this->_view->assign('questionType', $_POST['question_type']); $this->_view->assign('word_gameType', $gameTypeList[$_POST['game_type']]); $this->_view->assign('title', $_POST['title']); $this->_utilMsg->createNavBar(); $this->_view->display(); } }
/** * 用exlce文件中的用户账号,查询用户 */ public function actionUserQueryByExcel() { $this->_createServerList(); if ($this->_isPost()) { if (!strtotime($_POST['StartTime']) || !strtotime($_POST['EndTime'])) { $this->_utilMsg->showMsg(Tools::getLang('PLZ_INSERT_CORRECT_TIME', 'Common'), -1); } $file = $_FILES['upload']; $postData = array(); if ($file['error'] == 0) { $this->_loadCore('Help_FileUpload'); $helpFileUpload = new Help_FileUpload($file, EXCEL_DIR . '/' . date('Ymd'), 1024 * 1024 * 8, array('xls', 'xlsx')); $helpFileUpload->singleUpload(); $fileInfo = $helpFileUpload->getSaveInfo(); $this->_loadCore('Help_Excel'); $helpExcel = new Help_Excel($fileInfo['path']); $excelData = $helpExcel->getData(0); array_shift($excelData); foreach ($excelData as $sub) { $postData[$sub[0]] = $sub[0]; } } $postData = implode(',', $postData); $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($_REQUEST['server_id']); $this->_utilFRGInterface->setGet(array('c' => 'UserData', 'a' => 'ExportUser')); $this->_utilFRGInterface->setPost(array('StartTime' => $_POST['StartTime'], 'EndTime' => $_POST['EndTime'], 'UserNames' => $postData)); $data = $this->_utilFRGInterface->callInterface(); if ($data['msgno'] != 0) { $this->_utilMsg->showMsg($data['message'], -1); } Tools::import('Util_ExportExcel'); $this->_utilExportExcel = new Util_ExportExcel($_GET['server_id'] . '_' . CURRENT_TIME, 'Excel/UserInfo', $data['data']); $this->_utilExportExcel->outPutExcel(); return; } $operatorList = $this->_getGlobalData('operator_list'); $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name'); $this->_view->assign('operatorList', $operatorList); $this->_utilMsg->createNavBar(); $this->_view->display(); }
public function _getOperatorIdByMark($gameTypeId, $marking) { if (strpos($marking, '|') === false) { return false; } list($mark, $server) = explode('|', $marking); Tools::import('Cache_OperatorSetup'); switch ($gameTypeId) { case 1: $operatorList = Cache_OperatorSetup::getBtoConf(); break; case 2: $operatorList = Cache_OperatorSetup::getFrgConf(); break; } if (!isset($operatorList)) { return false; } foreach ($operatorList as $key => $list) { if ($list['mark'] == $mark) { return array('operator_id' => $key, 'url' => str_replace('{$var}', Tools::getNum($server), $list['url']), 'server' => $server); } } return false; }
/** * 超时回复列表 */ public function actionTimeoutReply() { #------初始化------# $this->_loadCore('Help_Page'); $this->_loadCore('Help_SqlSearch'); $helpSqlSearch = new Help_SqlSearch(); $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); $this->_modelWorkOrderQa = $this->_getGlobalData('Model_WorkOrderQa', 'object'); $qualityStatus = $this->_getGlobalData('quality_status'); $qualityOptions = $this->_getGlobalData('quality_options'); #------初始化------# $users = $this->_getGlobalData('user'); $allUser = Model::getTtwoArrConvertOneArr($users, 'user_name', 'nick_name'); $helpSqlSearch->set_tableName($this->_modelWorkOrderQa->tName()); $helpSqlSearch->set_conditions('is_timeout=1'); $helpSqlSearch->set_conditions('qa=1'); $helpSqlSearch->set_orderBy('create_time desc'); $helpSqlSearch->setPageLimit($_GET['page'], 20); $allConditions = $helpSqlSearch->get_conditions(); //返回所有条件 $helpPage = new Help_Page(array('total' => $this->_modelWorkOrderQa->findCount($allConditions), 'perpage' => 20)); $sql = $helpSqlSearch->createSql(); $dataList = $this->_modelWorkOrderQa->select($sql); if ($dataList) { Tools::import('Util_FontColor'); foreach ($dataList as &$value) { $value['word_is_quality'] = $value['is_quality'] ? $users[$value['is_quality']]['nick_name'] : '<font color="#666666">未质检</font>'; $value['word_reply_name'] = $allUser[$value['reply_name']]; $value['create_time'] = date('Y-m-d H:i:s', $value['create_time']); $value['last_reply_time'] = date('Y-m-d H:i:s', $value['last_reply_time']); $value['url_detail'] = Tools::url('QualityCheck', 'Dialog', array('Id' => $value['work_order_id'], 'game_type_id' => $value['game_type_id'], 'operator_id' => $value['operator_id'])); $value['content'] = strip_tags($value['content']); } $this->_view->assign('dataList', $dataList); } $this->_view->assign('pageBox', $helpPage->show()); $this->_view->assign('js', $this->_view->get_curJs()); $this->_utilMsg->createNavBar(); $this->_view->display(); }
<?php Tools::import('Log_LogBase'); class Log_GameLogin extends Log_LogBase { public function _init() { } function update(SplSubject $subject) { $playerType = array(1 => '玩家id', 2 => '玩家账号', 3 => '玩家昵称'); $arr = array($subject->_operatorId, $subject->_ordinal, $subject->_serverId, $subject->_playerAccount, $subject->_playerType, $subject->_cause); $modelGameOperateLog = $this->_getGlobalData('Model_GameOperateLog', 'object'); $AddLog = array(array('操作', '<font style="color:#F00">用户登录</font>'), array('操作时间', date('Y-m-d H:i:s', CURRENT_TIME)), array('操作人', '<b>{UserName}</b>'), array('操作原因', $subject->_cause), array('账号类型', $playerType[$subject->_playerType]), array('账号', $subject->_playerAccount)); $AddLog = $modelGameOperateLog->addInfoMake($AddLog); $userInfo['UserId'] = 0; $GameOperateLog = $modelGameOperateLog->MakeDataForStore($userInfo, 14, $subject->_serverId, $AddLog); // print_r($GameOperateLog);exit; if (false !== $GameOperateLog) { $modelGameOperateLog->add($GameOperateLog); } } }
/** * 获取运营商mark */ private function _getOperatorMark() { static $operatorIds = null; if (is_null($operatorIds)) { Tools::import('Cache_OperatorSetup'); $operatorList = Cache_OperatorSetup::getFrgConf(); $operatorIds = array(); foreach ($operatorList as $key => $list) { $operatorIds[$key] = $list['mark']; } } return $operatorIds; }
<?php Tools::import('Action_ActionBase'); class ActionGame_MasterTools_LockAccount_Default_1 extends Action_ActionBase { const INGAME = 'inGame'; const LOGTYPE = 1; public function main($UrlAppend = NULL, $get = NULL, $post = NULL) { if (!$_REQUEST['server_id']) { return array(); } $this->_assign['URL_silenceLocalLog'] = $this->_urlLocalLog(); $this->_assign['URL_silenceInGame'] = $this->_urlInGame(); switch ($_REQUEST['doaction']) { case self::INGAME: //拿游戏中实际封号数据 $this->_dataInLocalLog(); break; default: $getData = $this->_gameObject->getGetData($get); $getData["Page"] = max(0, intval($_GET['page'])); $data = $this->getResult($UrlAppend, $getData); // print_r($data); if ($data['states'] == '1') { $this->_assign['dataList'] = $data["List"]; $this->_loadCore('Help_Page'); $helpPage = new Help_Page(array('total' => $data["Count"], 'perpage' => PAGE_SIZE)); $this->_assign['pageBox'] = $helpPage->show(); } $this->_assign['gameData'] = 1;
/** * 我被质检过的回复 */ public function actionMyReplyQulity() { #------初始化------# $this->_loadCore('Help_Page'); $this->_loadCore('Help_SqlSearch'); $this->_helpSqlSearch = new Help_SqlSearch(); $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); $this->_modelReplyQulity = $this->_getGlobalData('Model_ReplyQulity', 'object'); $qualityStatus = $this->_getGlobalData('quality_status'); $qualityOptions = $this->_getGlobalData('quality_options'); #------初始化------# $allUser = $this->_getGlobalData('user'); $userClass = $this->_utilRbac->getUserClass(); $this->_helpSqlSearch->set_tableName($this->_modelReplyQulity->tName()); $this->_helpSqlSearch->set_conditions("user_id='{$userClass['_id']}'"); if ($_GET['option']) { $this->_helpSqlSearch->set_conditions("option_id={$_GET['option']}"); $this->_view->assign('selectedOption', $_GET['option']); } if ($_GET['status']) { $this->_helpSqlSearch->set_conditions("status={$_GET['status']}"); $this->_view->assign('selectedStatus', $_GET['status']); } if ($_GET['is_timeout'] != '') { $this->_helpSqlSearch->set_conditions("is_timeout={$_GET['is_timeout']}"); $this->_view->assign('selectedTimeout', $_GET['is_timeout']); } if ($_GET['scores']) { $this->_view->assign('selectedSource', $_GET['scores']); if ($_GET['scores'] == 1) { $this->_helpSqlSearch->set_conditions("scores<0"); } else { $this->_helpSqlSearch->set_conditions("scores>=0"); } } $this->_helpSqlSearch->set_orderBy('create_time desc'); $this->_helpSqlSearch->setPageLimit($_GET['page'], 20); $allConditions = $this->_helpSqlSearch->get_conditions(); //返回所有条件 $helpPage = new Help_Page(array('total' => $this->_modelReplyQulity->findCount($allConditions), 'perpage' => 20)); $sql = $this->_helpSqlSearch->createSql(); $dataList = $this->_modelReplyQulity->select($sql); if ($dataList) { Tools::import('Util_FontColor'); foreach ($dataList as &$value) { $value['create_time'] = date('Y-m-d H:i:s', $value['create_time']); $value['url_detail'] = Tools::url('QualityCheck', 'QualityDetail', array('work_order_id' => $value['work_order_id'], 'qa_id' => $value['qa_id'])); $value['word_quality_user_id'] = $allUser[$value['quality_user_id']]['nick_name']; $value['word_status'] = Util_FontColor::getQualityStatus($value['status'], $qualityStatus[$value['status']]); $value['content'] = strip_tags($value['content']); $value['word_option_id'] = $qualityOptions[$value['option_id']]; } $this->_view->assign('dataList', $dataList); } $qualityStatus[''] = Tools::getLang('ALL', 'Common'); $qualityOptions[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('qualityStatus', $qualityStatus); $this->_view->assign('qualityOptions', $qualityOptions); $this->_view->assign('scores', Tools::getLang('SOURCE', __CLASS__)); $this->_view->assign('timeout', Tools::getLang('TIMEOUT', __CLASS__)); $this->_view->assign('pageBox', $helpPage->show()); $this->_view->assign('js', $this->_view->get_curJs()); $this->_utilMsg->createNavBar(); $this->_view->display(); }