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,