12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace api\common\controller;
- use huolib\status\GameStatus;
- class FloatBaseController extends V2ApiBaseController {
- protected $game_id;
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- $this->checkGame();
- }
-
- 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;
- }
- }
|