Only return mnon-archived assets by location

This commit is contained in:
snipe 2017-11-03 21:46:11 -07:00
parent d7f8615964
commit 2522bfee9c

View file

@ -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()