Perbaikan Menu Laporan per pintu pos
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user