FIX_mobile number in api : ps

This commit is contained in:
VE10-Sanjeev 2024-07-05 06:27:48 +00:00
parent f3215236ce
commit 00d1e3f5bc

View File

@ -500,16 +500,18 @@ class ApiIntegration extends ResourceController
$countAll = $api_model->countAll('customers', $where);
$this->logger->info(($countAll) ? "Api SaveCustomerDetails : in wordpress customer ref ID = ".$wordpress_customer_id." is available on customer table and its PrimaryKey = ".$customer_id : "Api SaveBookDetails : in wordpress Customer ref ID = ".$wordpress_customer_id." Not available on Customer table");
$billing = $records['billing'];
if(isset($billing) && gettype($billing) === 'object') {$billing = [$billing];}
$customer_data['first_name'] = $records['first_name'];
$customer_data['last_name'] = $records['last_name'];
$customer_data['type'] = $records['role'];
$customer_data['email'] = $records['email'];
$customer_data['profile_picture'] = $records['avatar_url'];
$customer_data['mobile_no'] = !empty($billing) ? $billing[0]->phone : '';
$customer_data['wp_api_customer_id'] = $wordpress_customer_id;
$customer_data['mode'] = $this->global_variable_role;
$customer_data['business_id'] = $this->global_variable_business_id;
$billing = $records['billing'];
$shipping = $records['shipping'];
@ -537,7 +539,6 @@ class ApiIntegration extends ResourceController
$i = 0; $customer_billing_address_data = [];
$j = 0; $customer_shipping_address_data = [];
if(isset($billing) && gettype($billing) === 'object') {$billing = [$billing];}
if(isset($shipping) && gettype($shipping) === 'object') {$shipping = [$shipping];}
$this->logger->info("Api SaveCustomerDetails : billing count : " .count($billing));
$this->logger->info("Api SaveCustomerDetails : shipping count : " .count($shipping));