2017-07-28 76 views

回答

0

通过Prestashop管理面板,无法导出所有客户数据,因此您需要编写自定义SQL查询以选择PHPMYADMIN中的所有客户数据并导出CSV表。

使用以下查询可以选择所有拥有地址的客户。

select ps_customer.id_customer, ps_customer.email, ps_customer.firstname, 
 
ps_customer.lastname, ps_customer.passwd, ps_customer.company, 
 
ps_customer.birthday, ps_customer.newsletter, 
 
ps_address.id_country, ps_address.id_state, ps_address.address1, ps_address.address2, 
 
ps_address.postcode, ps_address.city, ps_address.phone, ps_address.vat_number 
 
from ps_customer INNER JOIN ps_address 
 
ON ps_customer.id_customer=ps_address.id_customer;

使用下面的查询,您可以选择谁是没有地址的所有客户。

SELECT id_customer, email, firstname, lastname, passwd, company, birthday, newsletter 
 
FROM ps_customer WHERE id_customer NOT IN (SELECT id_customer FROM ps_address);

定做根据客户的属性需要查询。

快乐阅读! :)