mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +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
@@ -14,7 +14,16 @@ class StockService extends BaseService
|
||||
const TRANSACTION_TYPE_PRODUCT_OPENED = 'product-opened';
|
||||
const TRANSACTION_TYPE_SELF_PRODUCTION = 'self-production';
|
||||
|
||||
public function GetCurrentStock($includeNotInStockButMissingProducts = false)
|
||||
public function GetCurrentStockOverview()
|
||||
{
|
||||
if (!GROCY_FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT) {
|
||||
return $this->getDatabase()->uihelper_stock_current_overview();
|
||||
} else {
|
||||
return $this->getDatabase()->uihelper_stock_current_overview_including_opened();
|
||||
}
|
||||
}
|
||||
|
||||
public function GetCurrentStock($includeNotInStockButMissingProducts = false)
|
||||
{
|
||||
$sql = 'SELECT * FROM stock_current';
|
||||
if ($includeNotInStockButMissingProducts)
|
||||
|
Reference in New Issue
Block a user