|
|
|
@ -308,30 +308,30 @@ class OtherController extends CommonController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 附加历史课程数据
|
|
|
|
// 附加历史课程数据
|
|
|
|
$historyCourses = HistoryCourse::whereHas('calendar', function ($query) {
|
|
|
|
// $historyCourses = HistoryCourse::whereHas('calendar', function ($query) {
|
|
|
|
$query->where('is_count_people', 1);
|
|
|
|
// $query->where('is_count_people', 1);
|
|
|
|
})->where(function ($query) use ($start_date, $end_date) {
|
|
|
|
// })->where(function ($query) use ($start_date, $end_date) {
|
|
|
|
// 开始结束日期的筛选。or查询
|
|
|
|
// // 开始结束日期的筛选。or查询
|
|
|
|
$query->whereBetween('start_time', [$start_date, $end_date])
|
|
|
|
// $query->whereBetween('start_time', [$start_date, $end_date])
|
|
|
|
->orWhereBetween('end_time', [$start_date, $end_date]);
|
|
|
|
// ->orWhereBetween('end_time', [$start_date, $end_date]);
|
|
|
|
})->where(function ($query) {
|
|
|
|
// })->where(function ($query) {
|
|
|
|
$course_type_id = request('course_type_id');
|
|
|
|
// $course_type_id = request('course_type_id');
|
|
|
|
if ($course_type_id) {
|
|
|
|
// if ($course_type_id) {
|
|
|
|
$course_type_id = explode(',', $course_type_id);
|
|
|
|
// $course_type_id = explode(',', $course_type_id);
|
|
|
|
$query->whereIn('type', $course_type_id);
|
|
|
|
// $query->whereIn('type', $course_type_id);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
})->get();
|
|
|
|
// })->get();
|
|
|
|
foreach ($historyCourses as $historyCourse) {
|
|
|
|
// foreach ($historyCourses as $historyCourse) {
|
|
|
|
$courseTypesSum[] = [
|
|
|
|
// $courseTypesSum[] = [
|
|
|
|
'course_type' => $historyCourse->typeDetail->name,
|
|
|
|
// 'course_type' => $historyCourse->typeDetail->name,
|
|
|
|
// 培养人数
|
|
|
|
// // 培养人数
|
|
|
|
'course_type_signs_pass' => $historyCourses->where('type', $historyCourse->type)->sum('course_type_signs_pass'),
|
|
|
|
// 'course_type_signs_pass' => $historyCourses->where('type', $historyCourse->type)->sum('course_type_signs_pass'),
|
|
|
|
// 去重培养人数
|
|
|
|
// // 去重培养人数
|
|
|
|
'course_type_signs_pass_unique' => $historyCourses->where('type', $historyCourse->type)->sum('course_type_signs_pass_unique'),
|
|
|
|
// 'course_type_signs_pass_unique' => $historyCourses->where('type', $historyCourse->type)->sum('course_type_signs_pass_unique'),
|
|
|
|
'course_name' => $historyCourse->course_name,
|
|
|
|
// 'course_name' => $historyCourse->course_name,
|
|
|
|
'course_signs_pass' => $historyCourse->course_signs_pass,
|
|
|
|
// 'course_signs_pass' => $historyCourse->course_signs_pass,
|
|
|
|
];
|
|
|
|
// ];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 区域明细统计
|
|
|
|
// 区域明细统计
|
|
|
|
$areas = CourseSign::area($start_date, $end_date, 1, $courses->pluck('id'), true);
|
|
|
|
$areas = CourseSign::area($start_date, $end_date, 1, $courses->pluck('id'), true);
|
|
|
|
|