This commit is contained in:
Dwi Swandhana
2026-04-20 09:46:42 +07:00
parent b139161cca
commit f964939863
2 changed files with 9 additions and 11 deletions
@@ -861,15 +861,13 @@ class ReportController extends Controller
$query->whereMonth('daftar', $bulan);
}
// 1. Ambil Data Pasien (Limit 50 per halaman agar RAM aman)
$orderbydate = $query->paginate(50);
$orderbydate->appends(['bulan' => $bulan, 'tahun' => $tahun]);
// Glass report perlu menampilkan seluruh hasil filter agar jumlah baris konsisten.
$orderbydate = $query->orderBy('daftar', 'ASC')->orderBy('id', 'ASC')->get();
// 2. Ambil Data Antibiotik HANYA untuk 50 pasien tersebut
$pageIds = $orderbydate->pluck('id')->toArray();
$antibiotikLookup = $this->mapAntibiotikData($pageIds);
$glassLookups = $this->getGlassReportLookups($orderbydate->getCollection());
$glassTables = $this->splitGlassReportRows($orderbydate->getCollection(), $glassLookups);
$pageIds = $orderbydate->pluck('id')->toArray();
$antibiotikLookup = $this->mapAntibiotikData($pageIds);
$glassLookups = $this->getGlassReportLookups($orderbydate);
$glassTables = $this->splitGlassReportRows($orderbydate, $glassLookups);
$glassHeaders = $this->getGlassReportHeaders();
return view('admin.glassreport', [
@@ -20,8 +20,8 @@
<table class="table table-bordered table-sm" id="tabel{{ $tableKey }}">
<thead>
<tr>
@foreach (($glassHeaders[$tableKey] ?? []) as $header)
<th>{{ $header }}</th>`
@foreach (($glassHeaders[$tableKey] ?? []) as $header)
<th>{{ $header }}</th>
@endforeach
</tr>
</thead>
@@ -82,4 +82,4 @@
});
});
</script>
@endpush
@endpush