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);
|
$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');
|
$timemark = date('Y-m-d H:i:s');
|
||||||
foreach ($customers as $customer) {
|
foreach ($customers as $customer) {
|
||||||
$this->api->ordersEdit($customer);
|
if ($searchEdit) {
|
||||||
|
$this->checkCustomers($customer, true);
|
||||||
|
} else {
|
||||||
|
$this->api->ordersEdit($customer);
|
||||||
|
}
|
||||||
time_nanosleep(0, 250000000);
|
time_nanosleep(0, 250000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +155,7 @@ class ApiHelper
|
|||||||
return $orders;
|
return $orders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkCustomers($customer)
|
private function checkCustomers($customer, $searchEdit = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
$criteria = array(
|
$criteria = array(
|
||||||
@ -189,6 +193,11 @@ class ApiHelper
|
|||||||
$_externalId = $customer['externalId'];
|
$_externalId = $customer['externalId'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ($searchEdit) {
|
||||||
|
$customer['externalId'] = $_externalId;
|
||||||
|
$this->api->customersEdit($customer);
|
||||||
|
}
|
||||||
|
|
||||||
return $_externalId;
|
return $_externalId;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user