diff --git a/app/models/Asset.php b/app/models/Asset.php index 9fcad6f461c8..f955c9a90111 100755 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -420,10 +420,12 @@ public function scopeTextSearch($query, $search) $query->where('name','LIKE','%'.$search.'%'); }); })->orWhere(function($query) use ($search) { - $query->whereHas('assigneduser', function($query) use ($search) { - $query->where('first_name','LIKE','%'.$search.'%') - ->orWhere('last_name','LIKE','%'.$search.'%'); - }); + $query->whereHas('assigneduser', function($query) use ($search) { + $query->where(function($query) use ($search) { + $query->where('first_name','LIKE','%'.$search.'%') + ->orWhere('last_name','LIKE','%'.$search.'%'); + }); + }); })->orWhere('name','LIKE','%'.$search.'%') ->orWhere('asset_tag','LIKE','%'.$search.'%') ->orWhere('serial','LIKE','%'.$search.'%')