From 70682f1ebbed4adec0fed8cdbf9c0b64855a026d Mon Sep 17 00:00:00 2001 From: koogua Date: Wed, 9 Dec 2020 16:01:04 +0800 Subject: [PATCH] =?UTF-8?q?!40=20=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=9C=AA=E8=BF=87=E6=BB=A42=20*=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E8=AF=BE=E7=A8=8B=E5=88=86=E7=B1=BB=20*=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E8=AF=BE=E7=A8=8B=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Services/Course.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Admin/Services/Course.php b/app/Http/Admin/Services/Course.php index b0f4bfdc..7f644d0d 100644 --- a/app/Http/Admin/Services/Course.php +++ b/app/Http/Admin/Services/Course.php @@ -251,8 +251,11 @@ class Course extends Service $list = []; + /** + * 没有二级分类的不显示 + */ foreach ($allCategories as $category) { - if ($category->level == 1) { + if ($category->level == 1 && $category->child_count > 0) { $list[$category->id] = [ 'name' => $category->name, 'value' => $category->id,