fix customer externalId

This commit is contained in:
Alex Lushpai 2014-09-05 16:38:09 +04:00
parent c5f691b8bf
commit cce894f8b6

View File

@ -47,7 +47,7 @@ class ApiHelper
if(count($customers) > 0 && isset($customers[0]['externalId'])) { if(count($customers) > 0 && isset($customers[0]['externalId'])) {
$order['customerId'] = $customers[0]['externalId']; $order['customerId'] = $customers[0]['externalId'];
} else { } else {
$order['customerId'] = ($data['customer_id'] != '') ? $data['customer_id'] : (microtime(true) * 10000) . mt_rand(1, 1000); $order['customerId'] = ($data['customer_id'] != '') ? $data['customer_id'] : (int) substr((microtime(true) * 10000) . mt_rand(1, 1000), 10, -1);
$customer['externalId'] = $order['customerId']; $customer['externalId'] = $order['customerId'];
$customer['firstName'] = $data['firstname']; $customer['firstName'] = $data['firstname'];
$customer['lastName'] = $data['lastname']; $customer['lastName'] = $data['lastname'];