当前位置: 首页>>代码示例>>PHP>>正文


PHP Model::getTtwoArrConvertOneArr方法代码示例

本文整理汇总了PHP中Model::getTtwoArrConvertOneArr方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::getTtwoArrConvertOneArr方法的具体用法?PHP Model::getTtwoArrConvertOneArr怎么用?PHP Model::getTtwoArrConvertOneArr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model的用法示例。


在下文中一共展示了Model::getTtwoArrConvertOneArr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getGameOperator

 /**
  * 返回二维数组,第一维键名:游戏id,第二维键名:游戏与运营商对应的id,第二维键值:运营商名
  * @author xy
  */
 public function getGameOperator($returnOptId = false)
 {
     $dataList = $this->select("select * from {$this->tName()}");
     $game = array();
     $operatorIds = $this->_getGlobalData('operator_list');
     $operatorIds = Model::getTtwoArrConvertOneArr($operatorIds, 'Id', 'operator_name');
     //运营商
     if ($returnOptId) {
         foreach ($dataList as $val) {
             $gameId = $val['game_type_id'];
             $opeartorId = $val['operator_id'];
             if (isset($operatorIds[$opeartorId])) {
                 $game[$gameId][$opeartorId] = $operatorIds[$opeartorId];
             }
         }
     } else {
         foreach ($dataList as $val) {
             $Id = $val['Id'];
             $gameId = $val['game_type_id'];
             $opeartorId = $val['operator_id'];
             if (isset($operatorIds[$opeartorId])) {
                 $game[$gameId][$Id] = $operatorIds[$opeartorId];
             }
         }
     }
     return $game;
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:31,代码来源:GameOperator.class.php

示例2: actionIndex

 function actionIndex()
 {
     $this->_modelLostPassword = $this->_getGlobalData('Model_LostPassword', 'object');
     $status = $this->_modelLostPassword->getStatus();
     $this->_view->assign('statusSelect', $status);
     $status[''] = Tools::getLang('ALL', 'Common');
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     $serverList = $this->_getGlobalData('gameser_list');
     $serverList = Model::getTtwoArrConvertOneArr($serverList, 'Id', 'server_name');
     $this->_utilMsg->createNavBar();
     $where = array();
     if ($this->_isPost()) {
         $selected['status'] = $_POST['status'];
         if (intval($_POST['status']) > 0) {
             $where['status'] = $_POST['status'];
         }
     }
     $order = 'status asc,Id desc';
     $dataList = $this->_modelLostPassword->getOrder($where, 1, $order);
     $this->_loadCore('Help_Page');
     $currUrl = Tools::url(CONTROL, 'EventList', $selected);
     $helpPage = new Help_Page(array('total' => $this->_modelLostPassword->getCount($where), 'perpage' => PAGE_SIZE, 'url' => $currUrl));
     $this->_view->assign('pageBox', $helpPage->show());
     $this->_view->assign('gameTypes', $gameTypes);
     $this->_view->assign('serverList', $serverList);
     $this->_view->assign('chargeType', $this->_modelLostPassword->getChargeType());
     $this->_view->assign('status', $this->_modelLostPassword->getStatus());
     $this->_view->assign('status', $status);
     $this->_view->assign('dataList', $dataList);
     $this->_view->assign('selected', $selected);
     $this->_view->display();
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:33,代码来源:LostPassword.class.php

示例3: __construct

 public function __construct()
 {
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     $this->_mainKind = $gameTypes;
     $this->_mainKind[0] = '网上银行';
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:7,代码来源:PlayerKindFaq.class.php

示例4: getOnlineUser

 /**
  * 获取在线所有用户
  * @param string $value online表字段,user_id/user_name(default)
  * @return array
  */
 public function getOnlineUser($value = 'user_name')
 {
     $users = $this->_modelOnlineUser->findAll();
     $users = Model::getTtwoArrConvertOneArr($users, null, $value);
     if (!is_array($users)) {
         $users = array();
     }
     return $users;
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:14,代码来源:Online.class.php

示例5: createBulletinKind

 /**
  * 建立公分类列表
  */
 public function createBulletinKind()
 {
     if (!$this->_bulletinKind) {
         $gameTypeList = $this->_getGlobalData('game_type');
         $gameType = Model::getTtwoArrConvertOneArr($gameTypeList, 'Id', 'name');
         $this->_bulletinKind = $gameType;
         $this->_bulletinKind['0'] = '公告';
     }
     return $this->_bulletinKind;
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:13,代码来源:Bulletin.class.php

示例6: __construct

 public function __construct()
 {
     $this->_createView();
     $this->_createUrl();
     $this->_utilMsg = $this->_getGlobalData('Util_Msg', 'object');
     $this->_modelPlayerFaq = $this->_getGlobalData('Model_PlayerFaq', 'object');
     $this->_modelPlayerKindFaq = $this->_getGlobalData('Model_PlayerKindFaq', 'object');
     $this->_modelServiceFaq = $this->_getGlobalData('Model_ServiceFaq', 'object');
     $this->_modelServiceKindFaq = $this->_getGlobalData('Model_ServiceKindFaq', 'object');
     $this->_modelSysconfig = $this->_getGlobalData('Model_Sysconfig', 'object');
     #------更改faq主分类------#
     $this->_faqKind = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
     #------更改faq主分类------#
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:14,代码来源:Faq.class.php

示例7: _createMultiServerList

 /**
  * 建立多服务器列表
  */
 private function _createMultiServerList()
 {
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $gameServerList = $this->_getGlobalData('gameser_list');
     foreach ($gameServerList as $key => &$value) {
         if ($value['game_type_id'] != 3) {
             unset($gameServerList[$key]);
         }
     }
     $this->_view->assign('gameServerList', json_encode($gameServerList));
     $this->_view->assign('tplServerSelect', 'GmSftx/MultiServerSelect.html');
     $this->_view->assign('operatorList', $operatorList);
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:17,代码来源:GmSftx.class.php

示例8: _createServerList

 /**
  * 单服务器选择列表
  */
 protected function _createServerList()
 {
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $gameServerList = $this->_getGlobalData('server/server_list_' . self::SFTX_ID);
     $this->_view->assign('gameServerList', json_encode($gameServerList));
     $this->_view->assign('tplServerSelect', 'Sftx/ServerSelect/ServerSelect.html');
     if ($_REQUEST['server_id']) {
         $this->_view->assign('display', true);
         $this->_view->assign('selectedServerId', $_REQUEST['server_id']);
         $this->_view->assign('selectedServername', $gameServerList[$_REQUEST['server_id']]['server_name']);
         $this->_operatorId = $gameServerList[$_REQUEST['server_id']]['operator_id'];
         $this->_view->assign('selectedOperatorId', $this->_operatorId);
     }
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:18,代码来源:Sftx.class.php

示例9: getMyOperator

 public function getMyOperator()
 {
     $operators = $this->_getGlobalData('operator_list');
     $operators = Model::getTtwoArrConvertOneArr($operators, 'Id', 'operator_name');
     if (!in_array($this->_userClass['_userName'], explode(',', MasterAccount))) {
         $returnDate = array();
         foreach ($this->_gameOperator as $sub) {
             $operator_id = $sub['operator_id'];
             if (array_key_exists($operator_id, $operators)) {
                 $returnDate[$operator_id] = $operators[$operator_id];
             }
         }
         return $returnDate;
     }
     return $operators;
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:16,代码来源:LyLink.class.php

示例10: getMyGame

 public function getMyGame()
 {
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     if (!in_array($this->_userClass['_userName'], explode(',', MasterAccount))) {
         $returnDate = array();
         foreach ($this->_gameOperator as $sub) {
             $gameId = $sub['game_type_id'];
             if (array_key_exists($gameId, $gameTypes)) {
                 $returnDate[$gameId] = $gameTypes[$gameId];
             }
         }
         return $returnDate;
     }
     return $gameTypes;
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:16,代码来源:LyPsdLink.class.php

示例11: createToCache

 /**
  * 建立缓存
  * @return void
  */
 public function createToCache()
 {
     $serverList = $this->select("select * from {$this->tName()} order by game_type_id");
     $operatorList = $this->_getGlobalData('operator_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
     $gameTypeList = $this->_getGlobalData('game_type');
     $gameTypeList = Model::getTtwoArrConvertOneArr($gameTypeList, 'Id', 'name');
     $tmpArr = array();
     $num = count($serverList);
     //建立缓存时,让条记录的ID,成为这个数组的key值,方便后期优化
     for ($i = 0; $i < $num; $i++) {
         $serverList[$i]['full_name'] = "{$serverList[$i]['server_name']}({$operatorList[$serverList[$i]['operator_id']]})[{$gameTypeList[$serverList[$i]['game_type_id']]}]";
         $tmpArr[$serverList[$i]['Id']] = $serverList[$i];
     }
     return $this->_addCache($tmpArr, $this->_cacheFile);
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:20,代码来源:GameSerList.class.php

示例12: _createGameServerSelect

 /**
  * 生成服务器列表
  * @param array $params
  */
 private function _createGameServerSelect($params)
 {
     $labelParams = '';
     $label = '<select name="game_server_id" >';
     $options = '';
     $operator = $this->_getGlobalData('operator_list');
     $serverList = $this->_getGlobalData('gameser_list');
     $operatorList = Model::getTtwoArrConvertOneArr($operator, 'Id', 'operator_name');
     foreach ($serverList as $value) {
         if ($value['game_type_id'] == $this->_selectedGameType) {
             $options .= "<option value=\"{$value['operator_id']},{$value['Id']}\">{$value['server_name']}({$operatorList[$value['operator_id']]})</option>";
         }
     }
     $label .= $options;
     $label .= '</select>';
     return array('title' => '请选择游戏服务器', 'description' => '选择服务器列表', 'label' => $label);
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:21,代码来源:QuickForm.class.php

示例13: actionAllAdd

 /**
  * 群发公告
  */
 public function actionAllAdd()
 {
     $this->_checkOperatorAct();
     $this->_createCenterServer();
     $servers = $this->_getAllServerIds();
     $serversInfo = $this->_getGlobalData('server/server_list_' . self::XUN_XIA_ID);
     $serversInfo = Model::getTtwoArrConvertOneArr($serversInfo, 'marking', 'server_name');
     $sendData = array();
     if ($this->_isPost()) {
         //die($_REQUEST['server_id']);
         if (empty($_POST['serverId'])) {
             $this->_utilMsg->showMsg('请选择发送的服务', -1);
         }
         $sendData = array();
         foreach ($_POST['serverId'] as $val) {
             if ($servers[$val]) {
                 $sendData['serverId'][$val] = $servers[$val];
                 $sendData['serversInfo'][$val] = isset($serversInfo[$servers[$val]]) ? $serversInfo[$servers[$val]] : $servers[$val];
             }
         }
         if (empty($sendData['serverId'])) {
             $this->_utilMsg->showMsg('服务器信息错误,请更新服务器', -1);
         }
         $sendData['serverId'] = implode(',', $sendData['serverId']);
         $this->getApi()->setUrl($_REQUEST['server_id'], 'oneNotice/notice');
         $data = $this->getApi()->saveNotice(strval($_POST['title']), strval($_POST['content']), strval($_POST['begin']), strval($_POST['end']), intval($_POST['interval']), $_POST['url'], $sendData['serverId']);
         if ($data === 0) {
             $this->_utilMsg->showMsg('添加公告成功', 1, Tools::url(CONTROL, 'AllAdd', array('zp' => 'XunXia', 'server_id' => $_REQUEST['server_id'])));
         } else {
             $this->_utilMsg->showMsg('添加公告失败', 1);
         }
     } else {
         //<input class="serverId" type="checkbox" value="S1" name="serverId[]">
         if ($servers) {
             $serverToSlt = array();
             foreach ($servers as $k => $v) {
                 $serverToSlt[$k] = "{$k}";
                 //$serverToSlt[$k] = isset($serversInfo[$v])?$serversInfo[$v]."($v)":$v;
             }
             $this->_view->assign('server', $serverToSlt);
         }
         //print_r($serverToSlt);
         $this->_utilMsg->createPackageNavBar();
         $this->_view->display();
     }
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:49,代码来源:XunXiaNotice.class.php

示例14: actionEdit

 /**
  * 编辑项目
  */
 public function actionEdit()
 {
     $this->_modelProgramProject = $this->_getGlobalData('Model_ProgramProject', 'object');
     if ($this->_isPost()) {
         $this->_modelProgramProject = $this->_getGlobalData('Model_ProgramProject', 'object');
         $info = $this->_modelProgramProject->edit($_POST);
         $this->_utilMsg->showMsg($info['msg'], $info['status'], $info['href']);
     } else {
         $users = $this->_modelProgramProject->findProjectUser(self::DEPARTMENT_IT, $_GET['Id']);
         $users['full_user'] = Model::getTtwoArrConvertOneArr($users['full_user'], 'Id', 'nick_name');
         $users['all_user'] = Model::getTtwoArrConvertOneArr($users['all_user'], 'Id', 'nick_name');
         $dataList = $this->_modelProgramProject->findById($_GET['Id']);
         $this->_view->assign('dataList', $dataList);
         $this->_view->assign('users', $users);
         $this->_utilMsg->createPackageNavBar();
         $this->_view->display();
     }
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:21,代码来源:ProgramProject.class.php

示例15: getApplyType

 public function getApplyType($ListType = 0, $gameId = 0)
 {
     switch ($ListType) {
         case 0:
             return false;
             break;
         case -1:
             //从缓存中拿到所有申请类型
             $ApplyType = $this->_getGlobalData($this->_cacheApplyTypeAll);
             break;
         default:
             //从缓存中拿到申请类型
             $ApplyType = $this->_getGlobalData($this->_cacheApplyType);
             $ApplyType = $ApplyType[$ListType];
             break;
     }
     if (empty($ApplyType)) {
         return false;
         //$this->_utilMsg->showMsg('List Type Error',-1);
     }
     if ($gameId) {
         $ApplyType = $ApplyType[$gameId];
     } else {
         $tmp = array();
         foreach ($ApplyType as $sub) {
             $tmp = array_merge($tmp, $sub);
         }
         $ApplyType = $tmp;
         unset($tmp);
     }
     if ($ApplyType) {
         return Model::getTtwoArrConvertOneArr($ApplyType, 'Id', 'name');
     } else {
         return array();
     }
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:36,代码来源:ApplyType.class.php


注:本文中的Model::getTtwoArrConvertOneArr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。