'invoice_amount_avg' =>
(float) $customer->
getOrderInformation()->
getAvgAmount(),
'invoice_amount_min' =>
(float) $customer->
getOrderInformation()->
getMinAmount(),
'invoice_amount_max' =>
(float) $customer->
getOrderInformation()->
getMaxAmount(),
'first_order_time' =>
$this->
formatDate($customer->
getOrderInformation()->
getFirstOrderTime()),
'last_order_time' =>
$this->
formatDate($customer->
getOrderInformation()->
getLastOrderTime()),
'has_canceled_orders' =>
$customer->
getOrderInformation()->
hasCanceledOrders(),
'ordered_at_weekdays' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getWeekdays()),
'ordered_in_shops' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getShops()),
'ordered_on_devices' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getDevices()),
'ordered_with_deliveries' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getDispatches()),
'ordered_with_payments' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getPayments()),
'ordered_products' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getProducts()),
'ordered_products_of_categories' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getCategories()),
'ordered_products_of_manufacturer' =>
$this->
implodeUnique($customer->
getOrderInformation()->
getManufacturers()),
];
return $data;
} private function createInsertQuery() { return $this->connection->
prepare( 'INSERT INTO s_customer_search_index (
id,
email,
active,
accountmode,
firstlogin,
newsletter,
shop_id,
default_billing_address_id,
title,
salutation,
firstname,
lastname,
birthday,
customernumber,
customer_group_id,
customer_group_name,
payment_id,
company,
department,
street,
zipcode,
city,
phone,
additional_address_line1,
additional_address_line2,
country_id,
country_name,
state_id,
age,
count_orders ,
invoice_amount_sum,
invoice_amount_avg,
invoice_amount_min,
invoice_amount_max,
first_order_time,
last_order_time,
has_canceled_orders,
ordered_at_weekdays,
ordered_in_shops,
ordered_on_devices,
ordered_with_deliveries,
ordered_with_payments,
product_avg,
ordered_products,
ordered_products_of_categories,
ordered_products_of_manufacturer,
index_time
) VALUES (
:id,
:email,
:active,
:accountmode,
:firstlogin,
:newsletter,
:shop_id,
:default_billing_address_id,
:title,
:salutation,
:firstname,
:lastname,
:birthday,
:customernumber,
:customer_group_id,
:customer_group_name,
:payment_id,
:company,
:department,
:street,
:zipcode,
:city,
:phone,
:additional_address_line1,
:additional_address_line2,
:country_id,
:country_name,
:state_id,
:age,
:count_orders,
:invoice_amount_sum,
:invoice_amount_avg,
:invoice_amount_min,
:invoice_amount_max,
:first_order_time,
:last_order_time,
:has_canceled_orders,
:ordered_at_weekdays,
:ordered_in_shops,
:ordered_on_devices,
:ordered_with_deliveries,
:ordered_with_payments,
:product_avg,
:ordered_products,
:ordered_products_of_categories,
:ordered_products_of_manufacturer,
NOW()
)'