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()
|
||||
]);
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-2">
|
||||
<label class="label" for="status_trans">Status Transaksi</label>
|
||||
<select id="status_transaksi" name="status_transaksi" class="form-control select2" data-placeholder="Semua">
|
||||
<option value="">Semua</option>
|
||||
<select id="status_transaksi" name="status_transaksi" class="form-control select2">
|
||||
<option value="" selected>Semua</option>
|
||||
<option value="0">Casual</option>
|
||||
<option value="3">Member</option>
|
||||
<option value="-1">Batal</option>
|
||||
|
||||
Reference in New Issue
Block a user