This commit is contained in:
2021-11-22 10:14:23 +08:00

View File

@@ -18,7 +18,11 @@ class CategoryController extends Controller
if ($category->type == Category::TYPE_SHOW && $category->article_id) { if ($category->type == Category::TYPE_SHOW && $category->article_id) {
return redirect("articles/" . $category->article_id); return redirect("articles/" . $category->article_id);
} else { } else {
$articles = $category->relations(Category::TYPE_ARTICLE)->where('status', 1)->latest()->paginate(); $articles = $category->relations(Category::TYPE_ARTICLE)
->where('status', 1)
->latest('sort')
->latest()
->paginate();
$parent = $category; $parent = $category;
if ($category->childrens->isEmpty() && $category->parent) { if ($category->childrens->isEmpty() && $category->parent) {