|
|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
|
|
use App\Exports\BaseExport;
|
|
|
|
|
use App\Exports\CommonExport;
|
|
|
|
|
use App\Helpers\ResponseCode;
|
|
|
|
|
use App\Models\AppointmentType;
|
|
|
|
|
use App\Models\Book;
|
|
|
|
|
@ -35,6 +36,9 @@ class CalendarsController extends BaseController
|
|
|
|
|
* tags={"日历管理"},
|
|
|
|
|
* summary="列表",
|
|
|
|
|
* description="",
|
|
|
|
|
* @OA\Parameter(name="is_export", in="query", @OA\Schema(type="string"), required=false, description="是否导出0否1是"),
|
|
|
|
|
* @OA\Parameter(name="export_fields", in="query", @OA\Schema(type="string"), required=false, description="需要导出的字段数组"),
|
|
|
|
|
* @OA\Parameter(name="file_name", in="query", @OA\Schema(type="string"), required=false, description="导出文件名"),
|
|
|
|
|
* @OA\Parameter(name="month", in="query", @OA\Schema(type="string"), required=true, description="月份"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
@ -55,6 +59,10 @@ class CalendarsController extends BaseController
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
$list = Calendar::with('course', 'courseContent')->where('start_time', 'like', $all['month'] . '%')->orderBy('date')->get();
|
|
|
|
|
if (isset($all['is_export']) && $all['is_export'] == 1) {
|
|
|
|
|
$list = $list->toArray();
|
|
|
|
|
return Excel::download(new CommonExport($list, $all['export_fields'] ?? ''), ($all['file_name'] ?? '') . date('YmdHis') . '.xlsx');
|
|
|
|
|
}
|
|
|
|
|
return $this->success($list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|