mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Use whereIn instead of where =
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
69e981364a
commit
e62a802926
|
@ -1561,7 +1561,7 @@ class Asset extends Depreciable
|
|||
$leftJoin->on('assets_dept_users.id', '=', 'assets.assigned_to')
|
||||
->where('assets.assigned_type', '=', User::class);
|
||||
})->where(function ($query) use ($search) {
|
||||
$query->where('assets_dept_users.department_id', '=', $search);
|
||||
$query->whereIn('assets_dept_users.department_id', $search);
|
||||
|
||||
})->withTrashed()->whereNull('assets.deleted_at'); //workaround for laravel bug
|
||||
}
|
||||
|
@ -1811,7 +1811,7 @@ class Asset extends Depreciable
|
|||
public function scopeInCategory($query, $category_id)
|
||||
{
|
||||
return $query->join('models as category_models', 'assets.model_id', '=', 'category_models.id')
|
||||
->join('categories', 'category_models.category_id', '=', 'categories.id')->where('category_models.category_id', '=', $category_id);
|
||||
->join('categories', 'category_models.category_id', '=', 'categories.id')->whereIn('category_models.category_id', $category_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1825,7 +1825,7 @@ class Asset extends Depreciable
|
|||
public function scopeByManufacturer($query, $manufacturer_id)
|
||||
{
|
||||
return $query->join('models', 'assets.model_id', '=', 'models.id')
|
||||
->join('manufacturers', 'models.manufacturer_id', '=', 'manufacturers.id')->where('models.manufacturer_id', '=', $manufacturer_id);
|
||||
->join('manufacturers', 'models.manufacturer_id', '=', 'manufacturers.id')->whereIn('models.manufacturer_id', $manufacturer_id);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue