mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Fixes #2134 - hide archived assets from list all
This commit is contained in:
parent
eee64d5509
commit
67315d81d6
|
@ -1676,6 +1676,9 @@ class AssetsController extends Controller
|
|||
case 'Deployed':
|
||||
$assets->Deployed();
|
||||
break;
|
||||
default:
|
||||
$assets->NotArchived();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -628,6 +628,23 @@ public function checkin_email()
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Query builder scope for non-Archived assets
|
||||
*
|
||||
* @param Illuminate\Database\Query\Builder $query Query builder instance
|
||||
*
|
||||
* @return Illuminate\Database\Query\Builder Modified query builder
|
||||
*/
|
||||
|
||||
public function scopeNotArchived($query)
|
||||
{
|
||||
|
||||
return $query->whereHas('assetstatus', function ($query) {
|
||||
|
||||
$query->where('archived', '=', 0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Query builder scope for Archived assets
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue