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

No files matched your search

@@ -861,15 +861,13 @@ class ReportController extends Controller
$query->whereMonth('daftar', $bulan); $query->whereMonth('daftar', $bulan);
} }
// 1. Ambil Data Pasien (Limit 50 per halaman agar RAM aman) // Glass report perlu menampilkan seluruh hasil filter agar jumlah baris konsisten.
$orderbydate = $query->paginate(50); $orderbydate = $query->orderBy('daftar', 'ASC')->orderBy('id', 'ASC')->get();
$orderbydate->appends(['bulan' => $bulan, 'tahun' => $tahun]);
// 2. Ambil Data Antibiotik HANYA untuk 50 pasien tersebut $pageIds = $orderbydate->pluck('id')->toArray();
$pageIds = $orderbydate->pluck('id')->toArray(); $antibiotikLookup = $this->mapAntibiotikData($pageIds);
$antibiotikLookup = $this->mapAntibiotikData($pageIds); $glassLookups = $this->getGlassReportLookups($orderbydate);
$glassLookups = $this->getGlassReportLookups($orderbydate->getCollection()); $glassTables = $this->splitGlassReportRows($orderbydate, $glassLookups);
$glassTables = $this->splitGlassReportRows($orderbydate->getCollection(), $glassLookups);
$glassHeaders = $this->getGlassReportHeaders(); $glassHeaders = $this->getGlassReportHeaders();
return view('admin.glassreport', [ return view('admin.glassreport', [
@@ -20,8 +20,8 @@
<table class="table table-bordered table-sm" id="tabel{{ $tableKey }}"> <table class="table table-bordered table-sm" id="tabel{{ $tableKey }}">
<thead> <thead>
<tr> <tr>
@foreach (($glassHeaders[$tableKey] ?? []) as $header) @foreach (($glassHeaders[$tableKey] ?? []) as $header)
<th>{{ $header }}</th>` <th>{{ $header }}</th>
@endforeach @endforeach
</tr> </tr>
</thead> </thead>