123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- /**
- * NewsController.php UTF-8
- * h5 wap 活动资讯
- *
- * @date : 2018/4/27 17:34
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : liuhongliang <lhl@huosdk.com>
- * @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');
- }
- }
|