Update
This commit is contained in:
@@ -51,10 +51,13 @@ class ApotekController extends Controller
|
|||||||
$query->where('tx_prescriptions.dTanggalresep', '<', $start_date);
|
$query->where('tx_prescriptions.dTanggalresep', '<', $start_date);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
->when($request->input('status') && $request->input('status') != 'all', function ($query, $status) {
|
->when($request->input('status'), function ($query, $status) {
|
||||||
$query->where(function ($query) use ($status) {
|
// Apply the filter if 'status' has a value
|
||||||
$query->where('tx_prescription_orders.sStatus', '=', $status);
|
if ($status !== 'all') {
|
||||||
});
|
$query->where(function ($query) use ($status) {
|
||||||
|
$query->where('tx_prescription_orders.sStatus', '=', $status);
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
->select(
|
->select(
|
||||||
'tx_prescriptions.nID as id',
|
'tx_prescriptions.nID as id',
|
||||||
|
|||||||
Reference in New Issue
Block a user