mirror of
https://github.com/retailcrm/legacy.git
synced 2024-11-25 06:46:03 +03:00
add search edit in updateCustomers
This commit is contained in:
parent
057de9af6f
commit
4803d0758f
@ -76,11 +76,15 @@ class ApiHelper
|
||||
$this->logger->put($timemark, $this->container->customersLog);
|
||||
}
|
||||
|
||||
public function updateCustomers($customers)
|
||||
public function updateCustomers($customers, $searchEdit = false)
|
||||
{
|
||||
$timemark = date('Y-m-d H:i:s');
|
||||
foreach ($customers as $customer) {
|
||||
if ($searchEdit) {
|
||||
$this->checkCustomers($customer, true);
|
||||
} else {
|
||||
$this->api->ordersEdit($customer);
|
||||
}
|
||||
time_nanosleep(0, 250000000);
|
||||
}
|
||||
|
||||
@ -151,7 +155,7 @@ class ApiHelper
|
||||
return $orders;
|
||||
}
|
||||
|
||||
private function checkCustomers($customer)
|
||||
private function checkCustomers($customer, $searchEdit = false)
|
||||
{
|
||||
|
||||
$criteria = array(
|
||||
@ -189,6 +193,11 @@ class ApiHelper
|
||||
$_externalId = $customer['externalId'];
|
||||
};
|
||||
|
||||
if ($searchEdit) {
|
||||
$customer['externalId'] = $_externalId;
|
||||
$this->api->customersEdit($customer);
|
||||
}
|
||||
|
||||
return $_externalId;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user