查询以获取 magento 中的客户完整记录.. 姓名、地址、密码、电子邮件、联系电话
SELECT concat((SELECT `value` FROM `customer_entity_varchar` WHERE `attribute_id`=5 AND `entity_id`= '$pup_owner'),' ', (SELECT `value` FROM `customer_entity_varchar` WHERE `attribute_id`=7 AND `entity_id`= '$pup_owner')) as `owner_name`,
concat((SELECT `value` FROM `customer_address_entity_text` WHERE `entity_id`= (select `value` FROM `customer_entity_int` WHERE `entity_id`='$pup_owner' AND `attribute_id`=14)), ',',(SELECT `value` FROM `customer_address_entity_varchar` WHERE `attribute_id`=26 AND `entity_id`= (select `value` FROM `customer_entity_int` WHERE `entity_id`='$pup_owner' AND `attribute_id`=14)),',' ,(SELECT `value` FROM `customer_address_entity_varchar` WHERE `attribute_id`=28 AND `entity_id`= (select `value` FROM `customer_entity_int` WHERE `entity_id`='$pup_owner' AND `attribute_id`=14))) as `owner_address`,
concat((SELECT `value` FROM `customer_address_entity_varchar` WHERE `attribute_id`=30 AND `entity_id`= (select `value` FROM `customer_entity_int` WHERE `entity_id`='$pup_owner' AND `attribute_id`=14)),'') as `owner_pincode` ,
concat((SELECT `email` FROM `customer_entity` WHERE `entity_id`= '$pup_owner'),'') as `owner_email` ,
concat((SELECT `value` FROM `customer_address_entity_varchar` WHERE `attribute_id`=31 AND `entity_id`= (select `value` FROM `customer_entity_int` WHERE `entity_id`='$pup_owner' AND `attribute_id`=14)),'') as `owner_contact`