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')