Update
This commit is contained in:
@@ -26,7 +26,9 @@ class ApotekController extends Controller
|
||||
$results = DB::connection('oldlms')->table('tx_prescriptions')
|
||||
->join('tx_prescription_orders', 'tx_prescription_orders.nIDPrescription', '=', 'tx_prescriptions.nID')
|
||||
->join('tm_users', 'tm_users.nID', '=', 'tx_prescriptions.nIDUser')
|
||||
->where('tx_prescription_orders.nIDApotek', '=', auth()->user()->organization_id)
|
||||
->when(auth()->user()->organization_id, function ($query, $organizationId) {
|
||||
$query->where('tx_prescription_orders.nIDApotek', '=', $organizationId);
|
||||
})
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('tx_prescriptions.sKodeResep', 'like', "%" . $search . "%")
|
||||
|
||||
Reference in New Issue
Block a user