record_logic = new RecordLogic(); } /** * 获取缴费记录列表 * @param Request $request * @param string $patient_id * @return JsonResponse * @throws GeneralException */ public function lists(Request $request, string $patient_id): JsonResponse { $validated = $request->validate([ 'start_date' => 'date_format:Y-m-d', 'end_date' => 'date_format:Y-m-d|after:start_date', ], [ 'start_date.date_format' => '日期格式错误', 'end_date.date_format' => '日期格式错误', 'end_date.after' => '查询日期错误', ]); $response = $this->record_logic->getRecordLists($patient_id, $validated['start_date'] ?? '', $validated['end_date'] ?? ''); return jsonResponse(Response::HTTP_OK, 'success', RecordListsResource::make($response)->toArray()); } /** * 获取缴费记录详情 * @param Request $request * @param string $patient_id * @param string $serial_no * @return JsonResponse * @throws GeneralException */ public function details(Request $request, string $patient_id, string $serial_no): JsonResponse { $response = $this->record_logic->getRecordDetails($patient_id, $serial_no); return jsonResponse(Response::HTTP_OK, 'success.', RecordDetailsResource::make($response)->toArray()); } }