comments num

This commit is contained in:
toogee 2020-05-17 18:03:08 +08:00
parent c29d6ebfa8
commit 987adc6b5f
2 changed files with 3 additions and 3 deletions

View File

@ -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(); $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(); $ad_article = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',4)->whereTime('slid_over','>=',time())->select();
//通用右栏 //通用右栏

View File

@ -164,7 +164,7 @@
{volist name="artHot" id="vo"} {volist name="artHot" id="vo"}
<dd> <dd>
<a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a> <a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a>
<span><i class="iconfont icon-pinglun1"></i> {$comments->count()}</span> <span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
</dd> </dd>
{/volist} {/volist}