From: Vladimir Fomichev Date: Tue, 14 Oct 2025 07:29:29 +0000 (+0300) Subject: Добавление строки с товарами в заказ X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f715fd2ff9d0a6a6c3874d82de0d2ea9620321f7;p=erp24_rep%2Fyii-erp24%2F.git Добавление строки с товарами в заказ --- diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 4a236fc3..2e4017ce 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -831,9 +831,11 @@ class DataController extends BaseController foreach ($marketplaceOrders as $marketplaceOrder) { /* @var MarketplaceOrders $marketplaceOrder */ $items = Json::decode(Json::encode($marketplaceOrder->items)); + $itemsToComment = ''; $itemsFiltered = []; $summ = 0; foreach ($items as $item) { + $itemsToComment .= $item['offer_id'] . ' - ' . $item['offer_id'] . ','; $product1c = Products1c::find()->where(['articule' => $item['offer_id']])->one(); if (!empty($product1c->id)) { $itemsFiltered []= [ @@ -891,6 +893,12 @@ class DataController extends BaseController } else { $itemsWithoutSkuString = ''; } + if(!empty($itemsToComment)) { + $itemsToCommentString = '. Товары в заказе: ' . $itemsToComment; + } + else { + $itemsToCommentString = $itemsToComment; + } $result[] = [ 'id' => $marketplaceOrder->guid, @@ -910,6 +918,7 @@ class DataController extends BaseController 'items' => $itemsFiltered, 'photo_link' => $photoLink, 'comment' => 'Создано из ERP ' . $marketplaceOrder->marketplace_order_id . + $itemsToCommentString . '. Доставка: ' . $deliveryString . $itemsWithoutSkuString // 'marketplace_order_id' => $marketplaceOrder->marketplace_order_id,