]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавление строки с товарами в заказ
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 14 Oct 2025 07:29:29 +0000 (10:29 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 14 Oct 2025 07:29:29 +0000 (10:29 +0300)
erp24/api2/controllers/DataController.php

index 4a236fc37c6f8d2210dc85ffaadc0702ad0841d4..2e4017ce903e97fdf33402d6a002bd55a303a88c 100644 (file)
@@ -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,