}
$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];
$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;
}
}
'order_id' => $order->guid,
'status' => $order->status_id,
'products' => $products,
- 'products_without_guid' => $productsWithoutGuid,
];
}