|
@@ -52,7 +52,7 @@ class NewsController extends HomeBaseController
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
* @throws \think\exception\DbException
|
|
* @throws \think\exception\DbException
|
|
|
*/
|
|
*/
|
|
|
- public function show(){
|
|
|
|
|
|
|
+ public function show(){
|
|
|
$param = $this->request->param();
|
|
$param = $this->request->param();
|
|
|
isset($param['id']) or $this->error('非法访问');
|
|
isset($param['id']) or $this->error('非法访问');
|
|
|
$cacheKey = 'cache:news_pages:show_' . $param['id'].'_'.intval(cmf_is_mobile());
|
|
$cacheKey = 'cache:news_pages:show_' . $param['id'].'_'.intval(cmf_is_mobile());
|
|
@@ -61,7 +61,7 @@ class NewsController extends HomeBaseController
|
|
|
Db::name('jiameng')->where('id', $param['id'])->setInc('hits', 1);
|
|
Db::name('jiameng')->where('id', $param['id'])->setInc('hits', 1);
|
|
|
|
|
|
|
|
if ($pageHtml) {
|
|
if ($pageHtml) {
|
|
|
- return $pageHtml;
|
|
|
|
|
|
|
+ // return $pageHtml;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$info = Db::name('news')->where('id',$param['id'])->where('status',1)->find();
|
|
$info = Db::name('news')->where('id',$param['id'])->where('status',1)->find();
|
|
@@ -108,9 +108,14 @@ class NewsController extends HomeBaseController
|
|
|
|
|
|
|
|
// 相关资讯
|
|
// 相关资讯
|
|
|
$other_news = NewsService::getListByCate($info['ncatid'], 10);
|
|
$other_news = NewsService::getListByCate($info['ncatid'], 10);
|
|
|
-
|
|
|
|
|
|
|
+ $id=$param['id'];
|
|
|
//相关动态和品牌动态 2020-08-24
|
|
//相关动态和品牌动态 2020-08-24
|
|
|
- $about_news = Db::name('news')->field('id,title,thumb,create_time')->where(['ncatid'=>1,'status'=> 1])->order('id desc')->limit(6)->select();
|
|
|
|
|
|
|
+ $about_news = Db::name('news')->field('id,title,thumb,create_time')->where(['status'=> 1])
|
|
|
|
|
+ ->where(function($query) use ($id){
|
|
|
|
|
+ $query->where('id','gt',$id);
|
|
|
|
|
+ })
|
|
|
|
|
+ ->order('list_order')->limit(6)->select();
|
|
|
|
|
+
|
|
|
$brand_news = Db::name('news')->field('id,title,thumb,create_time')->where(['catid'=>$info['catid'],'status'=> 1])->order('id desc')->limit(6)->select();
|
|
$brand_news = Db::name('news')->field('id,title,thumb,create_time')->where(['catid'=>$info['catid'],'status'=> 1])->order('id desc')->limit(6)->select();
|
|
|
|
|
|
|
|
$keywords = [];
|
|
$keywords = [];
|