From 2b354e9e46e8eb89d7a563144cf0ed9f7748edf7 Mon Sep 17 00:00:00 2001 From: Novy San87 Date: Thu, 6 Aug 2026 23:10:22 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20laporan=20rekap=20pakai=20snapshot=20stu?= =?UTF-8?q?dent=5Fclass=20(kelas=20saat=20pelanggaran)=20=E2=80=94=20akura?= =?UTF-8?q?t=20walau=20siswa=20naik=20kelas/lulus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/ViolationReportController.php | 8 ++++---- resources/views/reports/violation-report-pdf.blade.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Admin/ViolationReportController.php b/app/Http/Controllers/Admin/ViolationReportController.php index fcb23d1..4853be8 100644 --- a/app/Http/Controllers/Admin/ViolationReportController.php +++ b/app/Http/Controllers/Admin/ViolationReportController.php @@ -63,9 +63,9 @@ class ViolationReportController extends Controller ->sortByDesc('jumlah') ->values(); - $perKelas = $violations->groupBy(fn ($v) => $v->student?->class?->name ?? 'Tanpa Kelas') + $perKelas = $violations->groupBy(fn ($v) => $v->student_class ?: ($v->student?->class?->name ?? 'Tanpa Kelas')) ->map(fn ($group) => [ - 'kelas' => $group->first()->student?->class?->name ?? 'Tanpa Kelas', + 'kelas' => $group->first()->student_class ?: ($group->first()->student?->class?->name ?? 'Tanpa Kelas'), 'jumlah' => $group->count(), 'poin' => $group->sum('points'), ]) @@ -161,9 +161,9 @@ class ViolationReportController extends Controller ->sortByDesc('jumlah') ->values(); - $perKelas = $rows->groupBy(fn ($v) => $v->student?->class?->name ?? 'Tanpa Kelas') + $perKelas = $rows->groupBy(fn ($v) => $v->student_class ?: ($v->student?->class?->name ?? 'Tanpa Kelas')) ->map(fn ($group) => [ - 'kelas' => $group->first()->student?->class?->name ?? 'Tanpa Kelas', + 'kelas' => $group->first()->student_class ?: ($group->first()->student?->class?->name ?? 'Tanpa Kelas'), 'jumlah' => $group->count(), 'poin' => $group->sum('points'), ]) diff --git a/resources/views/reports/violation-report-pdf.blade.php b/resources/views/reports/violation-report-pdf.blade.php index b11be29..a7e28ce 100644 --- a/resources/views/reports/violation-report-pdf.blade.php +++ b/resources/views/reports/violation-report-pdf.blade.php @@ -159,7 +159,7 @@ {{ $v->violation_date?->format('d/m/Y') }} {{ $v->student?->nisn }} {{ $v->student?->full_name }} - {{ $v->student?->class?->name }} + {{ $v->student_class ?: $v->student?->class?->name }}
{{ $v->violationType?->name }} ({{ $v->violationType?->category?->name ?? '-' }})
@if ($v->description)