1
0
mirror of synced 2025-01-31 07:11:42 +03:00
Neur0toxine 5f69051859
Программа лояльности
* New module structure (refactoring)
* Simple serializer and deserializer with models, new architecture
* Move logic to strategies
* Partial api client facade implementation (full implementation is not necessary for now)
* Loyalty feature installer
* Sms verification order (#167)
* Make updater self-sufficient
* Fix for order submit & fix for incorrect component rendering in the constructor
* Fix for loyalty personal area error handling
* Fix for cart component identity
* Fix for softlock when customer cannot be registered in loyalty

Co-authored-by: Сергей Чазов <45812598+Chazovs@users.noreply.github.com>
Co-authored-by: Sergey Chazov <oitv18@gmail.com>
2021-11-16 10:48:26 +03:00

31 lines
1.2 KiB
PHP

<?php
define("NO_KEEP_STATISTIC", true);
require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
$GLOBALS['APPLICATION']->RestartBuffer();
$moduleId = 'intaro.retailcrm';
$historyTime = 'history_time';
$idOrderCRM = (int) $_REQUEST['idOrderCRM'];
if (CModule::IncludeModule($moduleId) && $idOrderCRM && $idOrderCRM > 0) {
$timeBd = COption::GetOptionString($moduleId, $historyTime, 0);
$nowDate = date('Y-m-d H:i:s');
if (!empty($timeBd)) {
$timeBdObj = new \DateTime($timeBd);
$newTimeBdObj = $timeBdObj->modify('+5 min');
$nowDateObj = new \DateTime($nowDate);
//If there is a record, but it is older than 5 minutes, overwrite
if ($newTimeBdObj < $nowDateObj) {
COption::SetOptionString($moduleId, $historyTime, $nowDate);
//call history
RCrmActions::orderAgent();
COption::RemoveOption($moduleId, $historyTime);
}
} else {
COption::SetOptionString($moduleId, $historyTime, $nowDate);
//call history
RCrmActions::orderAgent();
COption::RemoveOption($moduleId, $historyTime);
}
}