驾驶舱 课程体系

master
lion 3 days ago
parent 5c6b331a1c
commit ef32885472

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

Loading…
Cancel
Save