|
|
|
|
@ -839,6 +839,7 @@ class CourseController extends CommonController
|
|
|
|
|
* path="/api/mobile/course/calendars",
|
|
|
|
|
* tags={"小程序-课程"},
|
|
|
|
|
* summary="日历",
|
|
|
|
|
* @OA\Parameter(name="type", in="query", @OA\Schema(type="string"), required=false, description="类型"),
|
|
|
|
|
* @OA\Parameter(name="month", in="query", @OA\Schema(type="string"), required=false, description="月份,例如:2025-01"),
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
@ -862,8 +863,13 @@ class CourseController extends CommonController
|
|
|
|
|
// $startDate = $all['month'] . '-01';
|
|
|
|
|
// $endDate = date('Y-m-t', strtotime($startDate));
|
|
|
|
|
$list = Calendar::with('course', 'courseContent')
|
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
|
if (isset($all['type'])) {
|
|
|
|
|
$query->where('type', $all['type']);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
->orderBy('start_time', 'asc')
|
|
|
|
|
->whereDate('start_time', '<=', $all['month'])
|
|
|
|
|
->where('start_time', 'like', '%' . $all['month'] . '%')
|
|
|
|
|
->get();
|
|
|
|
|
|
|
|
|
|
// $range = getDates($startDate, $endDate);
|
|
|
|
|
|