|
|
|
@ -233,9 +233,11 @@ class OtherController extends CommonController
|
|
|
|
$calendar = Calendar::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
$calendar = Calendar::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
$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) use ($courses) {
|
|
|
|
})->where(function ($query) {
|
|
|
|
if (request('course_type_id')) {
|
|
|
|
$course_type_id = request('course_type_id');
|
|
|
|
$query->whereIn('course_type_id', request('course_type_id'));
|
|
|
|
if ($course_type_id) {
|
|
|
|
|
|
|
|
$course_type_id = explode(',', $course_type_id);
|
|
|
|
|
|
|
|
$query->whereIn('course_type_id1', $course_type_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$list['course_total'] = (clone $calendar)->count();
|
|
|
|
$list['course_total'] = (clone $calendar)->count();
|
|
|
|
@ -308,7 +310,13 @@ class OtherController extends CommonController
|
|
|
|
// 开始结束日期的筛选。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('type', $course_type_id)->get();
|
|
|
|
})->where(function ($query) {
|
|
|
|
|
|
|
|
$course_type_id = request('course_type_id', '');
|
|
|
|
|
|
|
|
$course_type_id = explode(',', $course_type_id);
|
|
|
|
|
|
|
|
if ($course_type_id) {
|
|
|
|
|
|
|
|
$query->whereIn('type', $course_type_id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})->get();
|
|
|
|
foreach ($historyCourses as $historyCourse) {
|
|
|
|
foreach ($historyCourses as $historyCourse) {
|
|
|
|
$courseTypesSum[] = [
|
|
|
|
$courseTypesSum[] = [
|
|
|
|
'course_type' => $historyCourse->typeDetail->name,
|
|
|
|
'course_type' => $historyCourse->typeDetail->name,
|
|
|
|
@ -699,11 +707,12 @@ class OtherController extends CommonController
|
|
|
|
// 开课场次明细 - 与coursesHome算法一致
|
|
|
|
// 开课场次明细 - 与coursesHome算法一致
|
|
|
|
$calendars = Calendar::whereBetween('date', [$start_date, $end_date])
|
|
|
|
$calendars = Calendar::whereBetween('date', [$start_date, $end_date])
|
|
|
|
->where(function ($query) use ($course_ids) {
|
|
|
|
->where(function ($query) use ($course_ids) {
|
|
|
|
if (request('course_type_id')) {
|
|
|
|
$course_type_id = request('course_type_id');
|
|
|
|
$query->whereIn('course_id', $course_ids);
|
|
|
|
if ($course_type_id) {
|
|
|
|
|
|
|
|
$course_type_id = explode(',', $course_type_id);
|
|
|
|
|
|
|
|
$query->whereIn('course_type_id', $course_type_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})->with('course')
|
|
|
|
->with('course')
|
|
|
|
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($calendars as $calendar) {
|
|
|
|
foreach ($calendars as $calendar) {
|
|
|
|
@ -731,8 +740,10 @@ class OtherController extends CommonController
|
|
|
|
// 开课天数明细 - 与coursesHome算法一致
|
|
|
|
// 开课天数明细 - 与coursesHome算法一致
|
|
|
|
$calendars = Calendar::whereBetween('date', [$start_date, $end_date])
|
|
|
|
$calendars = Calendar::whereBetween('date', [$start_date, $end_date])
|
|
|
|
->where(function ($query) use ($course_ids) {
|
|
|
|
->where(function ($query) use ($course_ids) {
|
|
|
|
if (request('course_type_id')) {
|
|
|
|
$course_type_id = request('course_type_id');
|
|
|
|
$query->whereIn('course_type_id', request('course_type_id'));
|
|
|
|
if ($course_type_id) {
|
|
|
|
|
|
|
|
$course_type_id = explode(',', $course_type_id);
|
|
|
|
|
|
|
|
$query->whereIn('course_type_id', $course_type_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})->where('is_count_days', 1)
|
|
|
|
})->where('is_count_days', 1)
|
|
|
|
->with('course')
|
|
|
|
->with('course')
|
|
|
|
|