This commit is contained in:
ivan-sim
2024-10-07 15:04:50 +07:00
parent f676f4a244
commit 82eca4b58a
2 changed files with 5 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ 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($request->input('search'), function ($query, $search) {
$query->where(function ($query) use ($search) {
$query->orWhere('tx_prescriptions.sKodeResep', 'like', "%" . $search . "%")