Perbaikan Menu Laporan per pintu pos

This commit is contained in:
pand03
2026-04-09 14:46:53 +07:00
parent 92dc9d6d2d
commit 67f6604f89
2 changed files with 19 additions and 5 deletions

View File

@@ -70,16 +70,28 @@ public function gateData(Request $request)
$akhir . ' 23:59:59'
])
// 🔹 STATUS
->when($request->status_transaksi, fn($q, $v) =>
$q->where('tp.status_transaksi', $v)
)
// // 🔹 STATUS
// ->when($request->status_transaksi, fn($q, $v) =>
// $q->where('tp.status_transaksi', $v)
// )
// 🔹 PINTU
->when($request->id_pintu_keluar, fn($q, $v) =>
$q->whereIn('tp.id_pintu_keluar', (array) $v)
)
// 🔹 Status Transaksi
->when($request->status_transaksi, function ($q) use ($request) {
return match ($request->status_transaksi) {
'3' => $q->where('tp.status_transaksi', '3'),
'0' => $q->where('tp.status_transaksi', '0'),
'-1' => $q->whereNotNull('alasan'),
'null' => $q->whereNull('alasan')
};
})
// 🔹 CARA BAYAR
->when($request->cara_bayar, function ($q) use ($request) {