mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
d2b88a5107
|
@ -1811,7 +1811,9 @@ class Asset extends Depreciable
|
||||||
public function scopeInCategory($query, $category_id)
|
public function scopeInCategory($query, $category_id)
|
||||||
{
|
{
|
||||||
return $query->join('models as category_models', 'assets.model_id', '=', 'category_models.id')
|
return $query->join('models as category_models', 'assets.model_id', '=', 'category_models.id')
|
||||||
->join('categories', 'category_models.category_id', '=', 'categories.id')->whereIn('category_models.category_id', $category_id);
|
->join('categories', 'category_models.category_id', '=', 'categories.id')
|
||||||
|
->whereIn('category_models.category_id', (!is_array($category_id) ? explode(',',$category_id): $category_id));
|
||||||
|
//->whereIn('category_models.category_id', $category_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1825,7 +1827,7 @@ class Asset extends Depreciable
|
||||||
public function scopeByManufacturer($query, $manufacturer_id)
|
public function scopeByManufacturer($query, $manufacturer_id)
|
||||||
{
|
{
|
||||||
return $query->join('models', 'assets.model_id', '=', 'models.id')
|
return $query->join('models', 'assets.model_id', '=', 'models.id')
|
||||||
->join('manufacturers', 'models.manufacturer_id', '=', 'manufacturers.id')->whereIn('models.manufacturer_id', $manufacturer_id);
|
->join('manufacturers', 'models.manufacturer_id', '=', 'manufacturers.id')->whereIn('models.manufacturer_id', (!is_array($manufacturer_id) ? explode(',',$manufacturer_id): $manufacturer_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue