1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 20:00:27 +08:00

!40 修复课程分类未过滤2

* 过滤课程分类
* 过滤课程分类
This commit is contained in:
koogua 2020-12-09 16:01:04 +08:00
parent e35c55a03f
commit 70682f1ebb

View File

@ -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,