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