1
0
mirror of synced 2025-01-31 23:31:41 +03:00

clear trash && fix find user

This commit is contained in:
Dmitry Mamontov 2015-02-16 11:44:14 +03:00
parent f93924eed4
commit 8c90db7d2c

View File

@ -1047,37 +1047,13 @@ class ICrmOrderActions
public static function uploadOrdersAgent() { public static function uploadOrdersAgent() {
self::uploadOrders(); self::uploadOrders();
$failedIds = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_FAILED_IDS, 0)); $failedIds = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_FAILED_IDS, 0));
if(is_array($failedIds) && !empty($failedIds)) if (is_array($failedIds) && !empty($failedIds)) {
self::uploadOrders(50, true); // upload failed orders self::uploadOrders(50, true);
}
return 'ICrmOrderActions::uploadOrdersAgent();'; return 'ICrmOrderActions::uploadOrdersAgent();';
} }
/**
*
* Agent function
*
* @return self name
*/
public static function orderHistoryAgent() {
self::orderHistory();
return 'ICrmOrderActions::orderHistoryAgent();';
}
/**
*
* Agent function
*
* @return self name
*/
public static function notForkedOrderAgent() {
self::uploadOrdersAgent();
self::orderHistory();
return 'ICrmOrderActions::notForkedOrderAgent();';
}
/** /**
* *
* Agent function * Agent function
@ -1086,18 +1062,12 @@ class ICrmOrderActions
*/ */
public static function orderAgent() { public static function orderAgent() {
$rsSites = CSite::GetList($by, $sort, array('DEF' => 'Y'));
$defaultSite = array();
while ($ar = $rsSites->Fetch()) {
$defaultSite = $ar;
break;
}
if(COption::GetOptionString('main', 'agents_use_crontab', 'N') != 'N') { if(COption::GetOptionString('main', 'agents_use_crontab', 'N') != 'N') {
define('NO_AGENT_CHECK', true); define('NO_AGENT_CHECK', true);
} }
self::notForkedOrderAgent(); self::uploadOrdersAgent();
self::orderHistory();
return 'ICrmOrderActions::orderAgent();'; return 'ICrmOrderActions::orderAgent();';
} }
@ -1520,7 +1490,7 @@ class RetailUser extends CUser
public function GetID() public function GetID()
{ {
$rsUser = CUser::GetList(($by='ID'), ($order='DESC'), array('LOGIN' => '%retailcrm%')); $rsUser = CUser::GetList(($by='ID'), ($order='DESC'), array('LOGIN' => 'retailcrm%'));
if ($arUser = $rsUser->Fetch()) { if ($arUser = $rsUser->Fetch()) {
return $arUser['ID']; return $arUser['ID'];
} else { } else {