From: Alexander Smirnov Date: Thu, 17 Apr 2025 14:11:09 +0000 (+0300) Subject: error in response X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e3c1d93ae42c578b09c4769c4cfb6515dddf3d1e;p=erp24_rep%2Fyii-erp24%2F.git error in response --- diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 08a0c84d..baf04e50 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -2232,12 +2232,6 @@ class DataController extends BaseController } } - if (!empty($result['created_new_orders'])) { - foreach ($result['created_new_orders'] as $arr) { - MarketplaceOrders::updateAll(['status_1c' => MarketplaceOrders::STATUSES_1C_SENDED_TO_1C], ['guid' => $arr['id']]); - } - } - if (!empty($result['created_orders'])) { $productsNames = Products1c::getNamesByTip('products'); foreach ($result['created_orders'] as $arr) { @@ -2246,7 +2240,7 @@ class DataController extends BaseController } if (!empty($marketplaceOrders)) { /** @var MarketplaceOrders $marketplaceOrders */ - if (!empty($arr["errors"]) || !empty($arr["errors_items"])) { + if (!empty($arr["errors"]) || !empty($arr["error"]) || !empty($arr["errors_items"])) { $errorText = ''; if (!empty($arr["errors"])) { //"errors": [ @@ -2299,6 +2293,13 @@ class DataController extends BaseController } } + if (!empty($arr["error"])) { + //"error": "Ошибка преобразования ИД документа", + //"error_description": "ИД документа 01202307-2705-1039-09bc-100015809667 уже записан в системе", + $errorText .= $arr["error"]; + $errorText .= ' ,' . $arr['error_description']; + } + $marketplaceOrders->status_1c = MarketplaceOrders::STATUSES_1C_ERROR_1C; $marketplaceOrders->error_text = $errorText; $marketplaceOrders->save();