12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * GameserverController.php UTF-8
- *
- *
- * @date : 2018/5/28 16:47
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace api\cfloat\controller;
- use api\common\controller\CFloatBaseController;
- use huo\controller\game\GameServer;
- use huolib\constant\CommonConst;
- class GameserverController extends CFloatBaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- }
- /**
- * Client浮点获取游戏开服列表
- * http://doc.1tsdk.com/138?page_id=3275
- * 【域名】/cfloat/gameserver/list
- */
- public function index() {
- $_page = get_val($this->rq_data, 'page', 1); /* 页码 默认为1 代表第一页 1 */
- $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
- $_server_type = get_val($this->rq_data, 'server_type', 0); /*开服类型*/
- $_app_id = get_val($this->rq_data, 'app_id'); /* 游戏id */
- $_map = ['app_id' => $_app_id, 'is_delete' => CommonConst::CONST_NOT_DELETE];
- if (!empty($_server_type)) {
- $_map['server_type'] = $_server_type;
- }
- $_page = $_page.','.$_offset;
- $_server_list = (new GameServer())->getServerList($_map, $_page);;
- $this->returnData($_server_list);
- }
- }
|