|
|
|
|
@ -817,10 +817,17 @@ class CourseController extends CommonController
|
|
|
|
|
}
|
|
|
|
|
$startDate = $all['month'] . '-01';
|
|
|
|
|
$endDate = date('Y-m-t', strtotime($startDate));
|
|
|
|
|
dd($startDate,$endDate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$list = Calendar::with('course', 'courseContent')->where('date', 'like', $all['month'] . '%')->orderBy('date')->get();
|
|
|
|
|
$range = getDates($startDate, $endDate);
|
|
|
|
|
$list = [];
|
|
|
|
|
foreach ($range as $date) {
|
|
|
|
|
// 查询Calendar模型里start_time和end_time在日期内的数据,其中date是年月日,start_time和end_time是时分秒
|
|
|
|
|
$list[] = [
|
|
|
|
|
'date' => $date,
|
|
|
|
|
'details' => Calendar::with('course', 'courseContent')->whereDate('start_time', '>=', $date)
|
|
|
|
|
->whereDate('end_time', '<=', $date)
|
|
|
|
|
->get()
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
return $this->success($list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|