mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
修改文章默认排序按时间
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user