From daaf9a5befd01886989c85d81cbbb8179f039de5 Mon Sep 17 00:00:00 2001 From: fomichev Date: Mon, 11 Nov 2024 17:32:03 +0300 Subject: [PATCH] =?utf8?q?=D0=92=D1=81=D0=B5=20=D0=BD=D0=B5=20=D0=BD=D0=B0?= =?utf8?q?=D0=B9=D0=B4=D0=B5=D0=BD=D1=8B=D0=B5=20=D1=86=D0=B5=D0=BD=D1=8B?= =?utf8?q?=20=D0=BD=D0=B0=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MarketplaceService.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index 0f5ca4aa..b3420636 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -85,7 +85,17 @@ class MarketplaceService ->column(); // 2. Получение цен на букеты - $prices = ArrayHelper::map(Prices::findAll(['product_id' => $productsGuids]), 'product_id', 'price'); + // $prices = ArrayHelper::map(Prices::findAll(['product_id' => $productsGuids]), 'product_id', 'price'); + $allPrices = Prices::findAll(['product_id' => $productsGuids]); + $prices = ArrayHelper::map($allPrices, 'product_id', 'price'); + + + foreach ($productsGuids as $productId) { + if (!array_key_exists($productId, $prices)) { + $prices[$productId] = 0; + } + } + // 3. Получение состава букетов $bouquetComposition = []; -- 2.39.5