mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 03:40:10 +00:00
Improve Performance (#927)
* Stock-Overview: Reduce amount of database queries and FindObjectInArray()-calls * Speed-up stock_current by improving products_resolved and creating indices. * Review Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
committed by
GitHub
parent
7510c677f1
commit
42dc55625a
@@ -16,17 +16,13 @@ class StockController extends BaseController
|
||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['stock_expring_soon_days'];
|
||||
|
||||
return $this->renderPage($response, 'stockoverview', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name'),
|
||||
'currentStock' => $this->getStockService()->GetCurrentStockOverview(),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name'),
|
||||
'currentStock' => $this->getStockService()->GetCurrentStock(true),
|
||||
'currentStockLocations' => $this->getStockService()->GetCurrentStockLocations(),
|
||||
'missingProducts' => $this->getStockService()->GetMissingProducts(),
|
||||
'nextXDays' => $nextXDays,
|
||||
'productGroups' => $this->getDatabase()->product_groups()->orderBy('name'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('products'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('products'),
|
||||
'shoppingListItems' => $this->getDatabase()->shopping_list(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user