|
|
|
|
@ -146,8 +146,11 @@ class OtherController extends CommonController
|
|
|
|
|
->get();
|
|
|
|
|
// 课程统计
|
|
|
|
|
$courseTypes = CourseType::where('is_chart', 1)->where('is_history', 0)->get();
|
|
|
|
|
// 默认开始时间
|
|
|
|
|
$start_date = CourseType::START_DATE;
|
|
|
|
|
$end_date = date('Y-m-d');
|
|
|
|
|
// 默认结束日期一年以后
|
|
|
|
|
$end_date = date('Y-m-d', strtotime('+10 year'));
|
|
|
|
|
|
|
|
|
|
foreach ($courseTypes as $courseType) {
|
|
|
|
|
// 历史已开设期数
|
|
|
|
|
$historyCourse = HistoryCourse::whereHas('typeDetail', function ($query) use ($courseType) {
|
|
|
|
|
@ -163,7 +166,7 @@ class OtherController extends CommonController
|
|
|
|
|
// 历史课程培养人数去重
|
|
|
|
|
$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);
|
|
|
|
|
$courseType->now_course_signs_total = CourseSign::courseSignsTotalByUnique($start_date, $end_date, 1, $courses->pluck('id'), false, false);
|
|
|
|
|
|
|
|
|
|
// 已开设期数
|
|
|
|
|
$courseType->course_periods_total = $courseType->now_course_periods_total + $courseType->history_course_periods_total;
|
|
|
|
|
|