From 9177a95607b6c9b0f663826d2d1b73a715b46ea0 Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Fri, 8 Sep 2023 12:38:30 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#91633=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classes/general/order/RetailCrmOrder_v5.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index 6336bd4b..d9e42b58 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -423,15 +423,13 @@ class RetailCrmOrder $order['privilegeType'] = LoyaltyAccountService::getPrivilegeType($client, $arParams); $arUser = UserTable::getById($arOrder['USER_ID'])->fetch(); - $fioBitrix['firstName'] = $arUser['NAME']; - $fioBitrix['lastName'] = $arUser['LAST_NAME']; + $fioCrm = [$order['firstName'] ?? null, $order['lastName'] ?? null, $order['patronymic'] ?? null]; - $fioCrm[] = $order['firstName'] ?? null; - $fioCrm[] = $order['lastName'] ?? null; - $fioCrm[] = $order['patronymic'] ?? null; - - if (in_array($fioBitrix['firstName'], $fioCrm) && in_array($fioBitrix['lastName'], $fioCrm)) { + if (in_array($arUser['NAME'], $fioCrm)) { $order['firstName'] = $arUser['NAME']; + } + + if (in_array($arUser['LAST_NAME'], $fioCrm)) { $order['lastName'] = $arUser['LAST_NAME']; }