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

index 2e4017ce903e97fdf33402d6a002bd55a303a88c..a5e0bd61e2de9ab4f90496ff438bc9729fa5231e 100644 (file)
@@ -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[] = [