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