From 5fae28a4011acb272bf3dc45e84d2303de01a1ed Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 17 Jun 2025 17:18:12 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=B0?= =?utf8?q?=D0=BF=D0=B8=20=D0=B4=D0=BB=D1=8F=201=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/OrdersController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erp24/api2/controllers/OrdersController.php b/erp24/api2/controllers/OrdersController.php index 8ab6caec..491363a7 100644 --- a/erp24/api2/controllers/OrdersController.php +++ b/erp24/api2/controllers/OrdersController.php @@ -218,20 +218,23 @@ class OrdersController extends BaseController $result = []; foreach ($orders as $order) { - $products = []; + $items = []; foreach ($order->items as $product) { $product1c = Products1c::findOne(['articule' => $product->offer_id]); if ($product1c) { - $products[$product1c->id] = $product->count; + $items[] = [ + 'product_id' => $product1c->id ?? null, + 'quantity' => $product->count ?? null, + ]; } } $result[] = [ 'order_id' => $order->guid, 'status' => $order->status_id, - 'products' => $products, + 'items' => $items, ]; } -- 2.39.5