1
0
Fork 0
mirror of synced 2025-04-18 16:41:02 +00:00

repair activate field action

This commit is contained in:
Sergey Chazov 2021-09-21 19:36:58 +03:00 committed by Neur0toxine
parent bd143f03e1
commit c79336a5f2
2 changed files with 8 additions and 11 deletions

View file

@ -349,9 +349,8 @@ class Register extends Controller
//Если отметка не стоит, но аккаунт активирован на стороне CRM
if ($response !== null && $response->errorMsg === GetMessage('ALREADY_ACTIVE')) {
$loyaltyAccountService->setLoyaltyActivateFlag($USER->GetID());
return [
'status' => 'activate',
];
return ['status' => 'activate'];
}
if ($response !== null && $response->loyaltyAccount->active === true) {

View file

@ -229,12 +229,13 @@ class LoyaltyAccountService
//Если отметка не стоит, но аккаунт активирован на стороне CRM
if ($activateResponse->errorMsg === GetMessage('ALREADY_ACTIVE')) {
$this->setLoyaltyActivateFlag($USER->GetID());
return [
'msg' => GetMessage('REG_COMPLETE'),
];
return ['msg' => GetMessage('REG_COMPLETE')];
}
if ($activateResponse->success && $activateResponse->loyaltyAccount->active === true) {
$this->setLoyaltyActivateFlag($USER->GetID());
return ['msg' => GetMessage('REG_COMPLETE')];
}
@ -404,7 +405,7 @@ class LoyaltyAccountService
global $USER_FIELD_MANAGER;
$USER_FIELD_MANAGER->Update('USER', $userId, ['UF_REG_IN_PL_INTARO' => true]);
$USER_FIELD_MANAGER->Update('USER', $userId, ['UF_EXT_REG_PL_INTARO' => true]);
}
/**
@ -461,7 +462,6 @@ class LoyaltyAccountService
/**
* @param int $userId
* @param string $userPhone
* @param array $customFields
* @param \Intaro\RetailCrm\Model\Bitrix\UserLoyaltyData $loyalty
*
* @return array|string[]|null
@ -485,9 +485,7 @@ class LoyaltyAccountService
return ['msg' => $errorMsg];
}
/**
* создать получилось, но аккаунт не активен
*/
//Создать получилось, но аккаунт не активен
if ($createResponse !== null
&& $createResponse->success === true
&& $createResponse->loyaltyAccount->active === false