AngelDisc Posted May 25, 2011 Share Posted May 25, 2011 Bonjour.Je cherche une solution avec MySQL pour faire une action x jours après une commande. $emails = Db::getInstance()->ExecuteS(' SELECT DISTINCT c.id_customer, firstname, lastname, email, o.date_add FROM '._DB_PREFIX_.'customer c LEFT JOIN '._DB_PREFIX_.'orders o ON (c.id_customer = o.id_customer) WHERE o.valid = 1 ORDER BY date_add'); je pense qu'il faut placer un truc du genre DATE_SUB(CURDATE(),INTERVAL 10 DAY), mais je ne sais comment faire.Pouvez vous m'aider un peu.Merci Link to comment Share on other sites More sharing options...
AngelDisc Posted May 25, 2011 Author Share Posted May 25, 2011 Voilà le résultat si quelqu'un à un jour besoin. Db::getInstance()->ExecuteS(' SELECT DISTINCT c.id_customer, o.id_order, firstname, lastname, email, o.date_add FROM '._DB_PREFIX_.'customer c LEFT JOIN '._DB_PREFIX_.'orders o ON (c.id_customer = o.id_customer) WHERE o.`date_add` BETWEEN DATE_SUB(CURRENT_DATE(),INTERVAL 2 DAY) AND DATE_SUB(CURRENT_DATE(),INTERVAL 1 DAY)'); Si le code peu être amélioré, je suis preneur 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