From: fomichev Date: Wed, 9 Apr 2025 07:16:14 +0000 (+0300) Subject: Вычисление средней цены X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=5fc18fc1e4d6d172ab06119d8edbc1915874e5de;p=erp24_rep%2Fyii-erp24%2F.git Вычисление средней цены --- diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index 2ffb6b3e..b1ed5cbe 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -477,10 +477,10 @@ class StorePlanService if (!empty($priceRecords)) { $totalPrice = 0; - $records = ArrayHelper::getColumn((array)$priceRecords, 'price'); + $records = ArrayHelper::toArray($priceRecords); $count = count($records); foreach ($priceRecords as $record) { - if ($record->price) { + if (isset($record->price)) { $totalPrice += $record->price; } }