]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки по расчету продаж товаров
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 24 Jul 2025 11:05:49 +0000 (14:05 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 24 Jul 2025 11:05:49 +0000 (14:05 +0300)
erp24/services/StorePlanService.php

index 2b70bf210786fb6f4105770ef85b06da46201fe7..308ebfdce40e74dc211e5831e7619acd4362679a 100755 (executable)
@@ -843,7 +843,7 @@ class StorePlanService
         Yii::warning( "Init (calculateMedianSalesForPeriod): {$initTime} ms\n");
         $t1 = hrtime(true);
       $rows = (new Query())
-            ->select(['sp.product_id', 'cnt' => 'COUNT(*)'])
+            ->select(['sp.product_id', 'cnt' => 'SUM(sp.quantity)'])
             ->from(['s' => 'sales'])
             ->innerJoin(['sp' => 'sales_products'], 's.id = sp.check_id')
             ->where(['sp.product_id' => $similarProductIds])