* @version : HUOSDK 8.0 */ namespace api\common\controller; use huolib\status\GameStatus; class FloatBaseController extends V2ApiBaseController { protected $game_id; public function _initialize() { parent::_initialize(); $this->checkLogin(); $this->checkGame(); } /** * 检查游戏ID是否上传 */ public function checkGame() { $_game_id = $this->request->get('game_id/d', 0); if (empty($_game_id)) { $_app_id = $this->request->get('app_id/d', 0); if (!empty($_app_id)) { $_game_id = $_app_id; } } if (empty($_game_id)) { $_code = GameStatus::GAME_ID_EMPTY; $this->error(GameStatus::getMsg($_code), [], $_code); } $this->game_id = $_game_id; } }