From: Vladimir Fomichev Date: Thu, 24 Jul 2025 11:05:49 +0000 (+0300) Subject: Правки по расчету продаж товаров X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=3aabb869dd5db4c6b2189aa2fdf7bcb5509ee4b8;p=erp24_rep%2Fyii-erp24%2F.git Правки по расчету продаж товаров --- diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index 2b70bf21..308ebfdc 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -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])