From: Vladimir Fomichev Date: Tue, 14 Oct 2025 07:34:53 +0000 (+0300) Subject: Добавление строки с товарами в заказ X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=d584bd2608a821cdfdd32e45c0df477992c276db;p=erp24_rep%2Fyii-erp24%2F.git Добавление строки с товарами в заказ --- diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 2e4017ce..a5e0bd61 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -831,11 +831,11 @@ class DataController extends BaseController foreach ($marketplaceOrders as $marketplaceOrder) { /* @var MarketplaceOrders $marketplaceOrder */ $items = Json::decode(Json::encode($marketplaceOrder->items)); - $itemsToComment = ''; + $itemsToComment = []; $itemsFiltered = []; $summ = 0; foreach ($items as $item) { - $itemsToComment .= $item['offer_id'] . ' - ' . $item['offer_id'] . ','; + $itemsToComment[] = $item['offer_id'] . ' - ' . $item['offer_name']; $product1c = Products1c::find()->where(['articule' => $item['offer_id']])->one(); if (!empty($product1c->id)) { $itemsFiltered []= [ @@ -894,10 +894,10 @@ class DataController extends BaseController $itemsWithoutSkuString = ''; } if(!empty($itemsToComment)) { - $itemsToCommentString = '. Товары в заказе: ' . $itemsToComment; + $itemsToCommentString = '. Товары в заказе: ' . implode(', ',$itemsToComment);; } else { - $itemsToCommentString = $itemsToComment; + $itemsToCommentString = ''; } $result[] = [