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