]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-360 Сборка страницы автопм origin/feature_zozirova_erp-423_send_orders_to_1c
authormarina <m.zozirova@gmail.com>
Tue, 17 Jun 2025 11:01:56 +0000 (14:01 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 17 Jun 2025 11:01:56 +0000 (14:01 +0300)
erp24/api2/controllers/OrdersController.php

index 1f6f09dc58386b3574157ec6b8d36adb6b7f9696..8ab6caec99c065315578614678786e15762ed13c 100644 (file)
@@ -199,9 +199,9 @@ class OrdersController extends BaseController
             }
 
             $storesGuidId = array_flip(array_filter(CityStore::getAllActiveGuidId(), fn($v) => is_int($v) || is_string($v)));
-            $storeGuid = $data['store-guid'] ?? null;
+            $storeGuid = $data['store_id'] ?? null;
             if (empty($storeGuid)) {
-                throw new \Exception('store-guid не передан или пуст');
+                throw new \Exception('store_id не передан или пуст');
             }
 
             $storeId = $storesGuidId[$storeGuid];
@@ -219,15 +219,12 @@ class OrdersController extends BaseController
             $result = [];
             foreach ($orders as $order) {
                 $products = [];
-                $productsWithoutGuid = [];
 
                 foreach ($order->items as $product) {
                     $product1c = Products1c::findOne(['articule' => $product->offer_id]);
 
                     if ($product1c) {
                         $products[$product1c->id] = $product->count;
-                    } else {
-                        $productsWithoutGuid[$product->offer_name] = $product->count;
                     }
                 }
 
@@ -235,7 +232,6 @@ class OrdersController extends BaseController
                     'order_id' => $order->guid,
                     'status' => $order->status_id,
                     'products' => $products,
-                    'products_without_guid' => $productsWithoutGuid,
                 ];
             }