From bf750611cc11d82f6766356ad5186270af3945ab Mon Sep 17 00:00:00 2001 From: toogee Date: Tue, 12 May 2020 21:07:15 +0800 Subject: [PATCH] comment order --- app/index/controller/Article.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 12b4f3b..2aa1eaa 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -158,7 +158,7 @@ class Article extends BaseController ])->find($id); Cache::tag('tagArtDetail')->set('article_'.$id,$article,3600); } - $comments = $article->comments()->where('status',1)->paginate(10); + $comments = $article->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(10); $article->inc('pv')->update(); $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv');