mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Only return mnon-archived assets by location
This commit is contained in:
parent
d7f8615964
commit
2522bfee9c
|
@ -54,7 +54,12 @@ class Location extends SnipeModel
|
|||
|
||||
public function assets()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Asset', 'location_id');
|
||||
return $this->hasMany('\App\Models\Asset', 'location_id')
|
||||
->whereHas('assetstatus', function ($query) {
|
||||
$query->where('status_labels.deployable', '=', 1)
|
||||
->orWhere('status_labels.pending', '=', 1)
|
||||
->orWhere('status_labels.archived', '=', 0);
|
||||
});
|
||||
}
|
||||
|
||||
public function rtd_assets()
|
||||
|
|
Loading…
Reference in a new issue