| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php/** * GameController.php UTF-8 * 游戏处理类 * * @date    : 2018/1/19 16:14 * * @license 这不是一个自由软件,未经授权不许任何使用和传播。 * @author  : linjiebin <ljb@huosdk.com> * @version : HUOSDK 8.0 */namespace web\pc\controller\v8;use huolib\constant\GameConst;use web\common\controller\WebBaseController;use web\pc\logic\GameLogic;class GameController extends WebBaseController {    public function __construct() {        parent::__construct();    }    public function index() {        $_web_info = $this->web_info;        $this->set_seo($_web_info['web_basic']['company_name']);        $_type = $this->request->param('type', 0);        $_classify = $this->request->param('classify', 0);        $_name = $this->request->param('gamename', '');        $_page = $this->request->param('page', 0);        $_game_class = new GameLogic();        $_rdata['platform'] = $_game_class->gamePlatfromClass();        $_rdata['type'] = $_game_class->getCategory(['parent_id' => 0]);        $_rdata['theme'] = $_game_class->getCategory(['parent_id' => ['neq', 0]]);        if($_classify == GameConst::GAME_IOS){            $_classify = ['in',[GameConst::GAME_IOS,GameConst::GAME_IOS_SWITCH]];        }        $_map['classify'] = $_classify;        $_map['type'] = $_type;        $_map['name'] = $_name;        $_rdata['game_list'] = $_game_class->getList($_map, $_page.',10','-list_order');        if ($this->request->isAjax()) {            return $_rdata;        }        $this->assign($_rdata);        return $this->fetch('Game/index');    }    public function detail() {        $_gameid = $this->request->param('gameid', 0);        if (empty($_gameid)) {            $this->error('参数错误');        }        $_game_class = new GameLogic();        $_rdata['detail'] = $_game_class->getDetail(['id' => $_gameid]);        $_rdata['similar'] = $_game_class->getSimilarList($_gameid, $_rdata['detail']['category'], '1,5', '');        $_web_info = $this->web_info;        $this->set_seo($_web_info['web_basic']['company_name'],$_rdata['detail']['gamename']);        $this->assign($_rdata);        return $this->fetch('Game/detail');    }}
 |