From: marina Date: Tue, 17 Jun 2025 14:18:12 +0000 (+0300) Subject: правка апи для 1с X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=5fae28a4011acb272bf3dc45e84d2303de01a1ed;p=erp24_rep%2Fyii-erp24%2F.git правка апи для 1с --- 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, ]; }