ref #87457 сhanging check UserId in order
This commit is contained in:
parent
f45c560330
commit
04e9b20c63
1 changed files with 13 additions and 10 deletions
|
@ -495,19 +495,17 @@ class RetailCrmOrder
|
|||
continue;
|
||||
}
|
||||
|
||||
$user = UserTable::getById($order['USER_ID'])->fetch();
|
||||
|
||||
if (!$user) {
|
||||
if (empty($order['USER_ID'])) {
|
||||
RCrmActions::eventLog(
|
||||
'RetailCrmOrder::uploadOrders',
|
||||
'UserTable::getById',
|
||||
'Error find user: ' . $order['USER_ID'] . ' in order: ' . $order['ID']
|
||||
'Order::load',
|
||||
'The user does not exist in order: ' . $order['ID']
|
||||
);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
self::createCustomerForOrder($api, $arCustomer, $arCustomerCorporate,$arParams, $order, $site, $user);
|
||||
self::createCustomerForOrder($api, $arCustomer, $arCustomerCorporate,$arParams, $order, $site);
|
||||
|
||||
if (isset($order['RESPONSIBLE_ID']) && !empty($order['RESPONSIBLE_ID'])) {
|
||||
$managerService = ManagerService::getInstance();
|
||||
|
@ -591,13 +589,18 @@ class RetailCrmOrder
|
|||
array &$arCustomerCorporate,
|
||||
array &$arParams,
|
||||
array $order,
|
||||
$site,
|
||||
array $user = null
|
||||
$site
|
||||
): void {
|
||||
$optionsContragentType = RetailcrmConfigProvider::getContragentTypes();
|
||||
$user = UserTable::getById($order['USER_ID'])->fetch();
|
||||
|
||||
if (empty($user)) {
|
||||
$user = UserTable::getById($order['USER_ID'])->fetch();
|
||||
if (!$user) {
|
||||
RCrmActions::eventLog(
|
||||
'RetailCrmOrder::createCustomerForOrder',
|
||||
'UserTable::getById',
|
||||
'Error find user: ' . $order['USER_ID'] . ' in order: ' . $order['ID']
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if ('Y' === RetailcrmConfigProvider::getCorporateClientStatus()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue