|
|
|
|
@ -233,7 +233,11 @@ class OtherController extends CommonController
|
|
|
|
|
$calendar = Calendar::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
$query->whereBetween('start_time', [$start_date, $end_date])
|
|
|
|
|
->orWhereBetween('end_time', [$start_date, $end_date]);
|
|
|
|
|
})->whereIn('course_id', $courses->pluck('id'));
|
|
|
|
|
})->where(function ($query) use ($start_date, $courses) {
|
|
|
|
|
if ($start_date != CourseType::START_DATE) {
|
|
|
|
|
$query->whereIn('course_id', $courses->pluck('id'));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$list['course_total'] = (clone $calendar)->count();
|
|
|
|
|
// 开课天数
|
|
|
|
|
$list['course_day_total'] = (clone $calendar)->where('is_count_days', 1)->sum('days');
|
|
|
|
|
|