From 987adc6b5fbaba4e15dcadef9295bb696b2219dc Mon Sep 17 00:00:00 2001 From: toogee Date: Sun, 17 May 2020 18:03:08 +0800 Subject: [PATCH] comments num --- app/index/controller/Article.php | 4 ++-- view/taoler/index/article/detail.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index c8899a5..e68c300 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -132,7 +132,7 @@ class Article extends BaseController // 热议文章 - $artHot = ArticleModel::field('id,title')->withCount('comments')->where('status',1)->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); + $artHot = ArticleModel::field('id,title')->withCount('comments')->where(['status'=>1,'delete_time'=>0])->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); //分类右栏广告 $ad_cate = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',5)->whereTime('slid_over','>=',time())->select(); //通用右栏 @@ -178,7 +178,7 @@ class Article extends BaseController */ // 热议文章 - $artHot = ArticleModel::field('id,title')->withCount('comments')->where('status',1)->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); + $artHot = ArticleModel::field('id,title')->withCount('comments')->where(['status'=>1,'delete_time'=>0])->whereTime('create_time', 'year')->order('comments_count','desc')->limit(10)->select(); //文章广告 $ad_article = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',4)->whereTime('slid_over','>=',time())->select(); //通用右栏 diff --git a/view/taoler/index/article/detail.html b/view/taoler/index/article/detail.html index 998a011..4bd7342 100644 --- a/view/taoler/index/article/detail.html +++ b/view/taoler/index/article/detail.html @@ -164,7 +164,7 @@ {volist name="artHot" id="vo"}
{$vo.title} - {$comments->count()} + {$vo.comments_count}
{/volist}