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);