master
cody 1 week ago
parent 4cee61ebf5
commit 308b1dfe84

@ -153,17 +153,22 @@ class OtherController extends CommonController
$historyCourse = HistoryCourse::whereHas('typeDetail', function ($query) use ($courseType) {
$query->where('name', 'like', '%' . $courseType->name . '%');
})->get();
// 课程
$courses = Course::where('type', $courseType->id)->get();
// 历史课程期数
$courseType->history_course_periods_total = $historyCourse->count();
// 现在课程数据
$courseType->now_course_periods_total = Course::where('type', $courseType->id)->count();
// 历史课程培养人数去重
$courseType->history_course_signs_total = $historyCourse->sum('course_type_signs_pass_unique');
// 现在课程培养人数
$courseType->now_course_signs_total = CourseSign::courseSignsTotalByUnique($start_date, $end_date, 1, $courses->pluck('id'), null);
// 课程
$courses = Course::where('type', $courseType->id)->get();
// 已开设期数
$courseType->course_periods_total = Course::where('type', $courseType->id)->count() + $courseType->history_course_periods_total;
$courseType->course_periods_total = $courseType->now_course_periods_total + $courseType->history_course_periods_total;
// 培养人数去重
$courseType->course_signs_total = $courseType->history_course_signs_total + CourseSign::courseSignsTotalByUnique($start_date, $end_date, 1, $courses->pluck('id'), null);
$courseType->course_signs_total = $courseType->history_course_signs_total + $courseType->now_course_signs_total;
}

Loading…
Cancel
Save