mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Add 'where' clause to hasManyThrough relationship. (#4276)
This commit is contained in:
parent
abcce78944
commit
189574377a
|
@ -54,7 +54,7 @@ class Location extends SnipeModel
|
|||
|
||||
public function assets()
|
||||
{
|
||||
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id');
|
||||
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id')->where("assets.assigned_type",User::class);
|
||||
}
|
||||
|
||||
public function locationAssets()
|
||||
|
|
Loading…
Reference in a new issue