reportService = $reportService; } /** * 获取预约总体统计报表 */ public function getAppointmentOverallReport(Request $request) { $dateType = $request->input('date_type', 'daily'); // daily, weekly, monthly $startDate = $request->input('start_date', date('Y-m-d')); $endDate = $request->input('end_date', date('Y-m-d')); $departmentId = $request->input('department_id'); $channelId = $request->input('channel_id'); $patientType = $request->input('patient_type'); // 验证参数 if (!in_array($dateType, ['daily', 'weekly', 'monthly'])) { return Rs::error('日期类型错误,只支持 daily、weekly、monthly'); } $result = $this->reportService->getAppointmentOverallReport( $dateType, $startDate, $endDate, $departmentId, $channelId, $patientType ); return $result['success'] ? Rs::success($result['data']) : Rs::error($result['message']); } /** * 获取时间段分布报表 */ public function getTimeDistributionReport(Request $request) { $startDate = $request->input('start_date', date('Y-m-d')); $endDate = $request->input('end_date', date('Y-m-d')); $departmentId = $request->input('department_id'); $resourceId = $request->input('resource_id'); $channelId = $request->input('channel_id'); $patientType = $request->input('patient_type'); $result = $this->reportService->getTimeDistributionReport( $startDate, $endDate, $departmentId, $resourceId, $channelId, $patientType ); return $result['success'] ? Rs::success($result['data']) : Rs::error($result['message']); } }