From 2ed3daae8dea4584b5837baff1c0a796807d14cd Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 10 Jul 2024 11:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E7=AB=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8E=92=E5=BA=8F=E6=8C=89=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 118510d..7e133b9 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -50,15 +50,15 @@ class Index extends Common $categorys_where = PostCategory::whereIn('category_id', $categorys); - $model_post = Post::hasWhere('categorys', $categorys_where)->where('status', 1)->order('id desc'); + $model_post = Post::hasWhere('categorys', $categorys_where)->where('status', 1)->order('publish_time desc'); } else { $model_sub_category = Category::find($sub_category_id); $page_title .= "-{$model_sub_category->title}"; - $model_post = Post::hasWhere('categorys', ['category_id' => $sub_category_id])->where('status', 1)->order('id desc'); + $model_post = Post::hasWhere('categorys', ['category_id' => $sub_category_id])->where('status', 1)->order('publish_time desc'); } } else { - $model_post = Post::where('status', 1)->order('id desc'); + $model_post = Post::where('status', 1)->order('publish_time desc'); } $model_post->where('type', 3);