return Shopware()->
Db()->
fetchAssoc($sql,
[$sendTime]);
} /**
* @param int[] $orderIds
*
* @return array
*/
public function getCustomers($orderIds) { $orderIds =
Shopware()->
Db()->
quote($orderIds);
$sql = "
SELECT
b.orderID,
b.company AS billing_company,
b.department AS billing_department,
b.salutation AS billing_salutation,
u.customernumber,
b.firstname AS billing_firstname,
b.lastname AS billing_lastname,
b.street AS billing_street,
b.zipcode AS billing_zipcode,
b.city AS billing_city,
b.phone AS phone,
b.phone AS billing_phone,
b.countryID AS billing_countryID,
bc.countryname AS billing_country,
bc.countryiso AS billing_countryiso,
bca.name AS billing_countryarea,
bc.countryen AS billing_countryen,
b.ustid,
ba.text1 AS billing_text1,
ba.text2 AS billing_text2,
ba.text3 AS billing_text3,
ba.text4 AS billing_text4,
ba.text5 AS billing_text5,
ba.text6 AS billing_text6,
b.orderID as orderID,
s.company AS shipping_company,
s.department AS shipping_department,
s.salutation AS shipping_salutation,
s.firstname AS shipping_firstname,
s.lastname AS shipping_lastname,
s.street AS shipping_street,
s.zipcode AS shipping_zipcode,
s.city AS shipping_city,
s.countryID AS shipping_countryID,
sc.countryname AS shipping_country,
sc.countryiso AS shipping_countryiso,
sca.name AS shipping_countryarea,
sc.countryen AS shipping_countryen,
sa.text1 AS shipping_text1,
sa.text2 AS shipping_text2,
sa.text3 AS shipping_text3,
sa.text4 AS shipping_text4,
sa.text5 AS shipping_text5,
sa.text6 AS shipping_text6,
u.*,
g.id AS preisgruppe,
g.tax AS billing_net
FROM
s_order_billingaddress as b
LEFT JOIN s_order_shippingaddress as s
ON s.orderID = b.orderID
LEFT JOIN s_user as u
ON b.userID = u.id
LEFT JOIN s_user_addresses as ub
ON u.default_billing_address_id = ub.id
AND u.id = ub.user_id
LEFT JOIN s_core_countries as bc
ON bc.id = b.countryID
LEFT JOIN s_core_countries as sc
ON sc.id = s.countryID
LEFT JOIN s_core_customergroups as g
ON u.customergroup = g.groupkey
LEFT JOIN s_core_countries_areas bca
ON bc.areaID = bca.id
LEFT JOIN s_core_countries_areas sca
ON sc.areaID = sca.id
LEFT JOIN s_order_billingaddress_attributes ba
ON b.id = ba.billingID
LEFT JOIN s_order_shippingaddress_attributes sa
ON s.id = sa.shippingID
WHERE b.orderID IN (