Информация по клиентам
SELECT DISTINCT cev.attribute_id, ea.attribute_code
FROM `customer_entity_varchar` AS cev
INNER JOIN `eav_attribute` AS ea
ON ea.attribute_id = cev.attribute_id
SELECT ce.entity_id, ce.email, cevcreated_id.value AS created_id, cevprefix.value AS prefix,
cevfirstname.value AS firstname, cevmiddlename.value AS middlename, cevlastname.value AS lastname, cevsuffix.value AS suffix,
cevpassword_hash.value AS password_hash, cevtaxvat.value AS taxvat, cevconfirmation.value AS confirmation,
cevrp_token.value AS rp_token, cevcompany.value AS company, cevcity.value AS city, cevtelephone.value AS telephone,
cevpd_phone .value AS pd_phone, caetstreet.value AS street
FROM `customer_entity` as ce
LEFT JOIN `customer_entity_varchar` AS cevcreated_id
ON cevcreated_id.entity_id = ce.entity_id AND cevcreated_id.attribute_id = 3
LEFT JOIN `customer_entity_varchar` AS cevprefix
ON cevprefix.entity_id = ce.entity_id AND cevprefix.attribute_id = 4
LEFT JOIN `customer_entity_varchar` AS cevfirstname
ON cevfirstname.entity_id = ce.entity_id AND cevfirstname.attribute_id = 5
LEFT JOIN `customer_entity_varchar` AS cevmiddlename
ON cevmiddlename.entity_id = ce.entity_id AND cevmiddlename.attribute_id = 6
LEFT JOIN `customer_entity_varchar` AS cevlastname
ON cevlastname.entity_id = ce.entity_id AND cevlastname.attribute_id = 7
LEFT JOIN `customer_entity_varchar` AS cevsuffix
ON cevsuffix.entity_id = ce.entity_id AND cevsuffix.attribute_id = 8
LEFT JOIN `customer_entity_varchar` AS cevpassword_hash
ON cevpassword_hash.entity_id = ce.entity_id AND cevpassword_hash.attribute_id = 12
LEFT JOIN `customer_entity_varchar` AS cevtaxvat
ON cevtaxvat.entity_id = ce.entity_id AND cevtaxvat.attribute_id = 15
LEFT JOIN `customer_entity_varchar` AS cevconfirmation
ON cevconfirmation.entity_id = ce.entity_id AND cevconfirmation.attribute_id = 16
LEFT JOIN `customer_entity_varchar` AS cevrp_token
ON cevrp_token.entity_id = ce.entity_id AND cevrp_token.attribute_id = 33
LEFT JOIN `customer_entity_varchar` AS cevcompany
ON cevcompany.entity_id = ce.entity_id AND cevcompany.attribute_id = 182
LEFT JOIN `customer_entity_varchar` AS cevcity
ON cevcity.entity_id = ce.entity_id AND cevcity.attribute_id = 184
LEFT JOIN `customer_entity_varchar` AS cevtelephone
ON cevtelephone.entity_id = ce.entity_id AND cevtelephone.attribute_id = 185
LEFT JOIN `customer_entity_varchar` AS cevpd_phone
ON cevpd_phone.entity_id = ce.entity_id AND cevpd_phone.attribute_id = 463
LEFT JOIN `customer_address_entity_text` AS caetstreet
ON caetstreet.entity_id = ce.entity_id AND caetstreet.attribute_id = 25
WHERE ce.website_id = 2