master
cody 3 months ago
parent f331205322
commit 92b96aaf50

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

Loading…
Cancel
Save