Pull out weird query scope that breaks stuff when querying large datasets

This commit is contained in:
snipe 2017-04-26 22:40:20 -07:00
parent f4cdeaa956
commit e088eea2f7

View file

@ -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.'%');