|
@@ -729,14 +729,12 @@ class ExamPdfExportService
|
|
|
'kp_codes' => $examKpCodes,
|
|
'kp_codes' => $examKpCodes,
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- // 获取上一个快照的数据(用于计算变化)
|
|
|
|
|
- // 如果没有其他试卷的记录,使用同一试卷的上一次快照
|
|
|
|
|
|
|
+ // 获取最新快照的数据(mastery_data 内已包含 current_mastery 和 previous_mastery)
|
|
|
$lastSnapshot = DB::connection('mysql')
|
|
$lastSnapshot = DB::connection('mysql')
|
|
|
->table('knowledge_point_mastery_snapshots')
|
|
->table('knowledge_point_mastery_snapshots')
|
|
|
->where('student_id', $studentId)
|
|
->where('student_id', $studentId)
|
|
|
->where('paper_id', $paper->paper_id)
|
|
->where('paper_id', $paper->paper_id)
|
|
|
->latest('snapshot_time')
|
|
->latest('snapshot_time')
|
|
|
- ->skip(1)
|
|
|
|
|
->first();
|
|
->first();
|
|
|
|
|
|
|
|
$previousMasteryData = [];
|
|
$previousMasteryData = [];
|