Code review

This commit is contained in:
Bernd Bestel
2017-04-21 12:30:08 +02:00
parent 5db288fc3c
commit 1d293741ba
10 changed files with 39 additions and 8 deletions

View File

@@ -8,7 +8,8 @@ class GrocyLogicStock
public static function GetCurrentStock()
{
return Grocy::ExecuteDbQuery(Grocy::GetDbConnectionRaw(), 'SELECT product_id, SUM(amount) AS amount, MIN(best_before_date) AS best_before_date from stock GROUP BY product_id ORDER BY MIN(best_before_date) ASC')->fetchAll(PDO::FETCH_OBJ);
$sql = 'SELECT product_id, SUM(amount) AS amount, MIN(best_before_date) AS best_before_date from stock GROUP BY product_id ORDER BY MIN(best_before_date) ASC';
return Grocy::ExecuteDbQuery(Grocy::GetDbConnectionRaw(), $sql)->fetchAll(PDO::FETCH_OBJ);
}
public static function GetProductDetails(int $productId)