mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Apply hotfix for fixed category model scope
This commit is contained in:
parent
827a86b2ef
commit
181e75adb4
|
@ -1360,8 +1360,8 @@ class Asset extends Depreciable
|
|||
*/
|
||||
public function scopeInCategory($query, $category_id)
|
||||
{
|
||||
return $query->join('models', 'assets.model_id', '=', 'models.id')
|
||||
->join('categories', 'models.category_id', '=', 'categories.id')->where('models.category_id', '=', $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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue