From 6bd49bfb72acc0c1c3cd4e241de83a55cce722d5 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 18 Oct 2017 01:20:50 -0700 Subject: [PATCH] Fixes #4191 - user search --- app/Models/Asset.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index d8df3f788a..889396928a 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -781,14 +781,11 @@ class Asset extends Depreciable $query->where('locations.name', 'LIKE', '%'.$search.'%'); }); })->orWhere(function ($query) use ($search) { - - $query->whereHas('assignedTo', function ($query) use ($search) { $query->where('users.first_name', 'LIKE', '%'.$search.'%') ->orWhere('users.last_name', 'LIKE', '%'.$search.'%') ->orWhere('users.username', 'LIKE', '%'.$search.'%') ->orWhere('locations.name', 'LIKE', '%'.$search.'%') ->orWhere('assigned_assets.name', 'LIKE', '%'.$search.'%'); - }); })->orWhere('assets.name', 'LIKE', '%'.$search.'%') ->orWhere('assets.asset_tag', 'LIKE', '%'.$search.'%') ->orWhere('assets.serial', 'LIKE', '%'.$search.'%')