From 3aabb869dd5db4c6b2189aa2fdf7bcb5509ee4b8 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Thu, 24 Jul 2025 14:05:49 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?utf8?q?=D0=BE=20=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82=D1=83=20=D0=BF?= =?utf8?q?=D1=80=D0=BE=D0=B4=D0=B0=D0=B6=20=D1=82=D0=BE=D0=B2=D0=B0=D1=80?= =?utf8?q?=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/StorePlanService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]) -- 2.39.5