修改列表

This commit is contained in:
2020-11-05 13:15:20 +08:00
parent efd2643443
commit 5036fb8b7b

View File

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