master
cody 2 weeks ago
parent d3a14ac743
commit dd8d71ceb6

@ -233,7 +233,7 @@ 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'));
$list['course_total'] = (clone $calendar)->count();
// 开课天数
$list['course_day_total'] = (clone $calendar)->where('is_count_days', 1)->sum('days');
@ -707,8 +707,9 @@ class OtherController extends CommonController
case 'course_day_total':
// 开课天数明细 - 与coursesHome算法一致
$calendars = Calendar::where('is_count_days', 1)
$calendars = Calendar::whereIn('course_id', $course_ids)
->whereBetween('date', [$start_date, $end_date])
->where('is_count_days', 1)
->with('course')
->get();

Loading…
Cancel
Save