* @version : HUOSDK 8.0 */ namespace h5wap\wap\controller; use h5wap\common\controller\V2BaseController; use huo\controller\game\GameList; use huo\controller\slide\Slide; use huo\controller\wap\Option; use huolib\constant\GameConst; use huolib\constant\SlideConst; use huolib\status\AdsStatus; use huolib\status\GameStatus; use huo\controller\member\Member; class HomeController extends V2BaseController { public function _initialize() { parent::_initialize(); } public function index() { $_mem_id = $this->mem_id; $_ads_class = new Slide(); $_hometopper = $_ads_class->getList(SlideConst::SLIDE_H5WAP_TOPPER);// TODO: wuyonghong 2018/4/27 首页轮播图 if (empty($_hometopper) || AdsStatus::NO_ERROR != $_hometopper['code']) { $_rdata['hometopper'] = null; } else { $_rdata['hometopper'] = $_hometopper['data']; } $_game_class = new GameList(); $_from = GameConst::GAME_H5; $_played_game = $_game_class->getPlayedList($_mem_id, $_from); if (empty($_played_game) || GameStatus::NO_ERROR != $_played_game['code']) { $_rdata['playedgame'] = null; } else { $_rdata['playedgame'] = $_played_game['data']; } $_hotgame = $_game_class->getHotList($_from); if (empty($_hotgame) || GameStatus::NO_ERROR != $_hotgame['code']) { $_rdata['hotgame'] = null; } else { $_rdata['hotgame'] = $_hotgame['data']; } if ($this->mem_id) { $_data = (new Member())->getMemInfo($this->mem_id); $_rdata['userinfo'] = $_data; } else { $_rdata['userinfo'] = null; } $this->assign('hometopper', $_rdata['hometopper']); $this->assign('playedgame', $_rdata['playedgame']); $this->assign('hotgame', $_rdata['hotgame']); $this->assign('userinfo', $_rdata['userinfo']); //添加seo优化信息 $_seo_data = Option::ins()->getSeoValue('h5_wap_index_seo'); $this->assign('seo', $_seo_data); return $this->fetch('home/index'); } }