* @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); } }