12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- /**
- * GameController.php UTF-8
- * H5浮点游戏控制
- *
- * @date : 2018/5/3 11:17
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace api\float\controller;
- use api\common\controller\FloatBaseController;
- use huo\controller\game\Game;
- use huo\controller\game\GameList;
- use huolib\constant\GameConst;
- use huolib\status\GameStatus;
- class GameController extends FloatBaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- }
- /**
- * H5浮点游戏列表
- * http://doc.1tsdk.com/138?page_id=3211
- * 【域名】/float/game/list
- */
- public function index() {
- $_game_id = $this->game_id;
- $_mem_id = $this->mem_id;
- $_page = $this->request->param('page/d', 1);
- $_offset = $this->request->param('offset/d', 10);
- $_gl_class = new GameList();
- $_from = GameConst::GAME_H5;
- $_rg_page = '1,3';
- $_rcmd_game = $_gl_class->getRcmdList($_from, $_rg_page);
- if (GameStatus::NO_ERROR != $_rcmd_game['code']) {
- $_rcmd_game = null;
- }
- $_rdata['rcmd_game'] = $_rcmd_game['data'];
- $_ng_page = "$_page,$_offset";
- $_new_game = $_gl_class->getNewList($_from, $_ng_page);
- if (GameStatus::NO_ERROR != $_new_game['code']) {
- $_new_game = null;
- }
- $_rdata['new_game'] = $_new_game['data'];
- $_code = GameStatus::NO_ERROR;
- $this->success(GameStatus::getMsg($_code), $_rdata, $_code);
- }
- }
|