USB83 Posted December 15, 2017 Share Posted December 15, 2017 (edited) Bonjour, Je cherche un moyen qui me permette d'exporter la liste de noms, emails et date de derniere commande des clients qui ont effectué au moins une commande sur ma boutique et qui vivent dans un certain pays. Tout aide serait grandement appréciée. Merci Prestashop 1.6 Edited December 15, 2017 by USB83 prestashop version (see edit history) Link to comment Share on other sites More sharing options...
Nico de Bordeaux Posted December 18, 2017 Share Posted December 18, 2017 j'ai pas testé, ni vérifié ... j'ai écrit ça à la volé mais tu as quelques pistes pour ce que tu veux faire... SELECT c.id_customer , c.lastname , c.firstname , c.email , cl.name , FROM ps_customer c LEFT JOIN ps_customer c ON (a.id_customer = c.id_customer) LEFT JOIN ps_country_lang cl ON (a.id_country = cl.id_country ) LEFT JOIN ps_orders o ON (o.id_customer = c.id_customer ) WHERE a.id_customer != 0 AND a.deleted = 0 -- verifie si le client a acheté quelque chose AND o.valid = 1 AND o.total_paid_real IS NOT NULL AND cl.name = TON PAYS GROUP BY c.id_customer ORDER BY c.id_customer ASC Link to comment Share on other sites More sharing options...
ChDUP Posted December 18, 2017 Share Posted December 18, 2017 Je valide juste une erreur de table sur la premiere jointure Ceci fonctionne SELECT c.id_customer , c.lastname , c.firstname , c.email FROM ps_customer c LEFT JOIN ps_address a ON (a.id_customer = c.id_customer) LEFT JOIN ps_country_lang cl ON (a.id_country = cl.id_country ) LEFT JOIN ps_orders o ON (o.id_customer = c.id_customer ) WHERE a.id_customer != 0 AND a.deleted = 0 -- verifie si le client a acheté quelque chose AND o.valid = 1 AND o.total_paid_real IS NOT NULL AND cl.name = 'Italie' GROUP BY c.id_customer ORDER BY c.id_customer ASC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now