From fea92e2fea0287b513d134dd856dcd706503ffcb Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Thu, 5 Nov 2020 13:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= 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 1c0d695..bdd329a 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(); + $articles = $category->relations(Category::TYPE_ARTICLE)->where('status', 1)->latest()->paginate(); $parent = $category; if ($parent->childrens->isEmpty()) { $parent = $category->parent;