12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * FloatBaseController.php UTF-8
- *
- *
- * @date : 2018/5/3 11:23
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @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;
- }
- }
|