+orderHistory agent
This commit is contained in:
parent
1d611ef2f7
commit
0ce0403311
@ -452,6 +452,18 @@ class ICrmOrderActions
|
||||
return 'ICrmOrderActions::uploadOrdersAgent();';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Agent function
|
||||
*
|
||||
* @return self name
|
||||
*/
|
||||
|
||||
public static function orderHistoryAgent() {
|
||||
self::orderHistory();
|
||||
return 'ICrmOrderActions::orderHistoryAgent();';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* creates order or returns array of order and customer for mass upload
|
||||
|
@ -906,10 +906,7 @@ class intaro_intarocrm extends CModule
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
//agent
|
||||
|
||||
//agents
|
||||
$dateAgent = new DateTime();
|
||||
$intAgent = new DateInterval('PT60S'); // PT60S - 60 sec;
|
||||
$dateAgent->add($intAgent);
|
||||
@ -925,6 +922,17 @@ class intaro_intarocrm extends CModule
|
||||
30
|
||||
);
|
||||
|
||||
CAgent::AddAgent(
|
||||
"ICrmOrderActions::orderHistoryAgent();",
|
||||
$this->MODULE_ID,
|
||||
"N",
|
||||
600, // interval - 10 mins
|
||||
$dateAgent->format('d.m.Y H:i:s'), // date of first check
|
||||
"Y", // агент активен
|
||||
$dateAgent->format('d.m.Y H:i:s'), // date of first start
|
||||
30
|
||||
);
|
||||
|
||||
$api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0);
|
||||
$api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0);
|
||||
$this->INTARO_CRM_API = new \IntaroCrm\RestApi($api_host, $api_key);
|
||||
|
Loading…
Reference in New Issue
Block a user