Perbaikan Menu Laporan per pintu pos

This commit is contained in:
pand03
2026-04-17 17:42:00 +07:00
parent 6b3a2ca72e
commit 47e4b6e178
2 changed files with 9 additions and 7 deletions

View File

@@ -81,12 +81,14 @@ public function gateData(Request $request)
)
// 🔹 Status Transaksi
->when($request->status_transaksi, function ($q) use ($request) {
// ->when($request->status_transaksi, function ($q) use ($request) {
->when(isset($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'),
'0' => $q->whereNotIn('tp.status_transaksi', ['3','-1'])->whereNotNull('alasan'),
// '0' => $q->whereNotIn('tp.status_transaksi', '5')->whereNotNull('alasan'),
'3' => $q->where('tp.status_transaksi', '3')->whereNull('alasan'),
'-1' => $q->where('tp.status_transaksi', '-1')->whereNotNull('alasan'),
'null' => $q->whereNull('alasan')
};
@@ -139,7 +141,7 @@ public function gateData(Request $request)
->orderBy('jm.nama')
->orderBy('tp.status_transaksi');
return response()->json([
'byGateData' => $query->get()
]);