From d5ce1b5cbf738a9312b5f33862aefe7f8a10845f Mon Sep 17 00:00:00 2001 From: toogee Date: Sat, 25 Apr 2020 17:36:24 +0800 Subject: [PATCH] article jie show --- app/index/controller/Article.php | 8 ++++---- app/index/controller/Index.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 6a3ed63..436160c 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -40,7 +40,7 @@ class Article extends BaseController switch ($type) { //查询文章,15个分1页 case 'jie': - $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([ + $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename'); }, @@ -51,7 +51,7 @@ class Article extends BaseController break; case 'hot': - $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([ + $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename'); }, @@ -62,7 +62,7 @@ class Article extends BaseController break; case 'top': - $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([ + $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename'); }, @@ -73,7 +73,7 @@ class Article extends BaseController break; default: - $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot')->with([ + $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename'); }, diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index e83bed2..66d735c 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -26,7 +26,7 @@ class Index extends BaseController //置顶文章 $artTop = Cache::get('arttop'); if(!$artTop){ - $artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([ + $artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top,jie')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename'); }, @@ -40,7 +40,7 @@ class Index extends BaseController //首页文章显示20条 $artList = Cache::get('artlist'); if(!$artList){ - $artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot')->with([ + $artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot,jie')->with([ 'cate' => function($query){ $query->where('delete_time',0)->field('id,catename'); },