mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Make DB migrations fully automatic
This commit is contained in:
@@ -8,8 +8,7 @@ class GrocyLogicStock
|
||||
|
||||
public static function GetCurrentStock()
|
||||
{
|
||||
$db = Grocy::GetDbConnectionRaw();
|
||||
return $db->query('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);
|
||||
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);
|
||||
}
|
||||
|
||||
public static function GetProductDetails(int $productId)
|
||||
|
Reference in New Issue
Block a user