From e088eea2f7827c1d889ca91a8f2fee5b7a141a79 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 26 Apr 2017 22:40:20 -0700 Subject: [PATCH] Pull out weird query scope that breaks stuff when querying large datasets --- app/Models/Accessory.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index c3ff9f3a16..1dbe768657 100755 --- a/app/Models/Accessory.php +++ b/app/Models/Accessory.php @@ -152,11 +152,6 @@ class Accessory extends SnipeModel $query->whereHas('company', function ($query) use ($search) { $query->where('companies.name', 'LIKE', '%'.$search.'%'); }); - })->orWhere(function ($query) use ($search) { - $query->whereHas('assetlog', function ($query) use ($search) { - $query->where('action_type', '=', 'checkout') - ->where('created_at', 'LIKE', '%'.$search.'%'); - }); })->orWhere(function ($query) use ($search) { $query->whereHas('location', function ($query) use ($search) { $query->where('locations.name', 'LIKE', '%'.$search.'%');