From 17691a6a1b15ef951ff2400a4a8a90695c33d8d3 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Thu, 25 Jul 2024 11:51:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=88=86=E7=B1=BB=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Logic/Course/CourseList.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Services/Logic/Course/CourseList.php b/app/Services/Logic/Course/CourseList.php index 1cfd9f5a..e5ee0e26 100644 --- a/app/Services/Logic/Course/CourseList.php +++ b/app/Services/Logic/Course/CourseList.php @@ -38,10 +38,11 @@ class CourseList extends LogicService $childCategoryIds = $categoryService->getChildCategoryIds($params['tc']); - /** - * 构造空记录条件 - */ - $params['category_id'] = $childCategoryIds ?: -999; + $parentCategoryIds = [$params['tc']]; + + $allCategoryIds = array_merge($parentCategoryIds, $childCategoryIds); + + $params['category_id'] = $allCategoryIds; } $params['published'] = 1;