Explorar o código

fix: persist analysis pdf url for ocr reports

yemeishu hai 1 semana
pai
achega
92a7c0d4c1
Modificáronse 1 ficheiros con 7 adicións e 7 borrados
  1. 7 7
      app/Services/ExamPdfExportService.php

+ 7 - 7
app/Services/ExamPdfExportService.php

@@ -4510,15 +4510,15 @@ class ExamPdfExportService
                         'student_id' => $studentId,
                         'url' => $url,
                     ]);
-
-                    return;
                 }
 
-                Log::warning('ExamPdfExportService: recordId未匹配OCR记录,回退写入学情分析PDF URL', [
-                    'record_id' => $recordId,
-                    'student_id' => $studentId,
-                    'paper_id' => $paperId,
-                ]);
+                if (! $ocrRecord) {
+                    Log::warning('ExamPdfExportService: recordId未匹配OCR记录,回退写入学情分析PDF URL', [
+                        'record_id' => $recordId,
+                        'student_id' => $studentId,
+                        'paper_id' => $paperId,
+                    ]);
+                }
             }
 
             // 【修复】同时更新 exam_analysis_results 表和分析报告表