mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Merge pull request #14711 from snipe/jerm/fix-all-query-in-sidebar-middleware
Fix memory-hog query in AssetCountForSidebar middleware
This commit is contained in:
commit
2decc3d6d3
|
@ -35,7 +35,7 @@ class AssetCountForSidebar
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$total_assets = Asset::all()->count();
|
$total_assets = Asset::count();
|
||||||
if ($settings->show_archived_in_list != '1') {
|
if ($settings->show_archived_in_list != '1') {
|
||||||
$total_assets -= Asset::Archived()->count();
|
$total_assets -= Asset::Archived()->count();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue