From 5036fb8b7b1243233497ac4d547a211ffe9d8801 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Thu, 5 Nov 2020 13:15:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/CategoryController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 8a8ea13..d826f28 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -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;