From ef3288547220479d441a98c44030465eb97acf95 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Thu, 9 Apr 2026 14:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E8=88=B1=20=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E4=BD=93=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/OtherController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/OtherController.php b/app/Http/Controllers/Admin/OtherController.php index 8cdeb09..4d507c1 100755 --- a/app/Http/Controllers/Admin/OtherController.php +++ b/app/Http/Controllers/Admin/OtherController.php @@ -231,13 +231,17 @@ class OtherController extends CommonController ->get(); // 2. 查询对应的 CourseType(仅一层归集:overview_parent_id 指向根体系) + // - 根体系:通常是 is_history=0 + // - 子体系:允许 is_history=1(额外添加体系),用于归集到根体系参与统计 $allCourseTypes = CourseType::where('is_chart', 1) - ->where('is_history', 0) ->orderBy('sort', 'asc') ->get(); // 根体系:没有归集到其他体系的类型 - $rootCourseTypes = $allCourseTypes->whereNull('overview_parent_id')->values(); + $rootCourseTypes = $allCourseTypes + ->whereNull('overview_parent_id') + ->where('is_history', 0) + ->values(); // 子体系:归集到某个根体系(仅一层) $childrenByRootId = $allCourseTypes ->whereNotNull('overview_parent_id')