|
|
|
@ -859,20 +859,25 @@ class CourseController extends CommonController
|
|
|
|
if ($validator->fails()) {
|
|
|
|
if ($validator->fails()) {
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$startDate = $all['month'] . '-01';
|
|
|
|
// $startDate = $all['month'] . '-01';
|
|
|
|
$endDate = date('Y-m-t', strtotime($startDate));
|
|
|
|
// $endDate = date('Y-m-t', strtotime($startDate));
|
|
|
|
$range = getDates($startDate, $endDate);
|
|
|
|
$list = Calendar::with('course', 'courseContent')
|
|
|
|
$list = [];
|
|
|
|
->orderBy('start_time', 'asc')
|
|
|
|
foreach ($range as $date) {
|
|
|
|
->whereDate('start_time', '<=', $all['month'])
|
|
|
|
// 查询Calendar模型里start_time和end_time在日期内的数据,其中date是年月日,start_time和end_time是时分秒
|
|
|
|
->get();
|
|
|
|
$list[] = [
|
|
|
|
|
|
|
|
'date' => $date,
|
|
|
|
// $range = getDates($startDate, $endDate);
|
|
|
|
'details' => Calendar::with('course', 'courseContent')
|
|
|
|
// $list = [];
|
|
|
|
->whereDate('start_time', '<=', $date)
|
|
|
|
// foreach ($range as $date) {
|
|
|
|
->whereDate('end_time', '>=', $date)
|
|
|
|
// // 查询Calendar模型里start_time和end_time在日期内的数据,其中date是年月日,start_time和end_time是时分秒
|
|
|
|
->get()
|
|
|
|
// $list[] = [
|
|
|
|
];
|
|
|
|
// 'date' => $date,
|
|
|
|
}
|
|
|
|
// 'details' => Calendar::with('course', 'courseContent')
|
|
|
|
|
|
|
|
// ->whereDate('start_time', '<=', $date)
|
|
|
|
|
|
|
|
// ->whereDate('end_time', '>=', $date)
|
|
|
|
|
|
|
|
// ->get()
|
|
|
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
// }
|
|
|
|
return $this->success($list);
|
|
|
|
return $this->success($list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|