update
This commit is contained in:
@@ -870,25 +870,25 @@ class ReportController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Query Periksa
|
// Query Periksa
|
||||||
$query = Periksa::query()->whereYear('daftar', $tahun);
|
$query = Periksa::query()->where('dlp', 'Kultur')->whereNotNull('dokter_id')->whereYear('daftar', $tahun);
|
||||||
if ($bulan != 'ALL' && $bulan != 'Pick Month') {
|
if ($bulan != 'ALL' && $bulan != 'Pick Month') {
|
||||||
$query->whereMonth('daftar', $bulan);
|
$query->whereMonth('daftar', $bulan);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preview dibuat paginated agar aman saat filter setahun.
|
// Preview dibuat paginated agar aman saat filter setahun.
|
||||||
$orderbydate = $query->orderBy('daftar', 'ASC')->orderBy('id', 'ASC')->paginate(50);
|
$orderbydate = $query->orderBy('daftar', 'ASC')->orderBy('id', 'ASC')->paginate(50);
|
||||||
$orderbydate->appends(['bulan' => $bulan, 'tahun' => $tahun]);
|
$orderbydate->appends(['bulan' => $bulan, 'tahun' => $tahun]);
|
||||||
|
|
||||||
$pageIds = $orderbydate->pluck('id')->toArray();
|
$pageIds = $orderbydate->pluck('id')->toArray();
|
||||||
$antibiotikLookup = $this->mapAntibiotikData($pageIds);
|
$antibiotikLookup = $this->mapAntibiotikData($pageIds);
|
||||||
$glassRows = $orderbydate->getCollection();
|
$glassRows = $orderbydate->getCollection();
|
||||||
$glassLookups = $this->getGlassReportLookups($glassRows);
|
$glassLookups = $this->getGlassReportLookups($glassRows);
|
||||||
$glassTables = $this->splitGlassReportRows($glassRows, $glassLookups);
|
$glassTables = $this->splitGlassReportRows($glassRows, $glassLookups);
|
||||||
$glassHeaders = $this->getGlassReportHeaders();
|
$glassHeaders = $this->getGlassReportHeaders();
|
||||||
|
|
||||||
return view('admin.glassreport', [
|
return view('admin.glassreport', [
|
||||||
'orderbydate' => $orderbydate,
|
'orderbydate' => $orderbydate,
|
||||||
'antibiotikLookup' => $antibiotikLookup, // Kirim array hasil mapping
|
'antibiotikLookup' => $antibiotikLookup,
|
||||||
'jsonantibiotik' => $this->listAntibiotik,
|
'jsonantibiotik' => $this->listAntibiotik,
|
||||||
'glassTables' => $glassTables,
|
'glassTables' => $glassTables,
|
||||||
'glassHeaders' => $glassHeaders,
|
'glassHeaders' => $glassHeaders,
|
||||||
@@ -920,7 +920,7 @@ class ReportController extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Query Tanpa Get() tapi Chunk()
|
// Query Tanpa Get() tapi Chunk()
|
||||||
$query = Periksa::query()->whereYear('daftar', $tahun);
|
$query = Periksa::query()->where('dlp', 'Kultur')->whereNotNull('dokter_id')->whereYear('daftar', $tahun);
|
||||||
if ($bulan != 'ALL' && $bulan != 'Pick Month') {
|
if ($bulan != 'ALL' && $bulan != 'Pick Month') {
|
||||||
$query->whereMonth('daftar', $bulan);
|
$query->whereMonth('daftar', $bulan);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user