* @version : HUOSDK 8.0 */ namespace h5wap\wap\controller; use h5wap\common\controller\V2BaseController; use huo\controller\posts\Posts; use huo\controller\wap\Option; use huolib\status\CommonStatus; class NewsController extends V2BaseController { /** * H5WAP资讯列表 * http://doc.1tsdk.com/138?page_id=3219 * 【域名】/wap/news/list * */ public function index() { $_param = $this->request->param(); $_news_class = new Posts(); $_data = $_news_class->getList($_param); $this->returnData($_data); } /** * 活动资讯详情页 * http://doc.1tsdk.com/138?page_id=3113 * * 【域名】/wap/news/detail * * @return mixed * @throws \think\Exception */ public function detail() { $_post_id = $this->request->param('news_id/d', 0); $_news_class = new Posts(); $_data = $_news_class->getDetail($_post_id); if (CommonStatus::NO_ERROR != $_data['code']) { $this->returnData($_data); } $_detail = $_data['data']; $this->assign('news', $_detail); //添加seo优化信息 $_seo_data = Option::ins()->getSeoValue('h5_wap_newsdetails_seo', 0, 0, $_post_id); $this->assign('seo', $_seo_data); return $this->fetch('news/detail'); } }