Nice-side Posted December 13, 2022 Share Posted December 13, 2022 Bonjour j'aimerai ajouter le champ numéro de téléphone potable de mes clients dans cette requête SQL pourriez-vous m'aider? SELECT d.id_order, d.product_name, o.date_add, o.reference, CONCAT_WS(' ', g.firstname, g.lastname) AS customer, o.total_paid_tax_incl, os.name AS state, d.product_reference, d.product_quantity, d.product_price, o.payment, c.name AS carrier_name, CONCAT_WS(' ', a.lastname, a.firstname, a.address1, a.address2, a.postcode, a.city) AS address_delivery, CONCAT_WS(' ', a.lastname, a.firstname, a.address1, a.address2, a.postcode, a.city) AS address_invoice, REPLACE(IFNULL(GROUP_CONCAT(cd.value), ''), '"', '\'') AS customized_data FROM ps_order_detail d LEFT JOIN ps_orders o ON (d.id_order = o.id_order) LEFT JOIN ps_customer g ON (o.id_customer = g.id_customer) LEFT JOIN ps_carrier c ON (o.id_carrier = c.id_carrier) LEFT JOIN ps_order_state_lang os ON (o.current_state = os.id_order_state) LEFT JOIN ps_address a ON (a.id_address = o.id_address_delivery) LEFT JOIN ps_address ab ON (ab.id_address = o.id_address_invoice) LEFT JOIN ps_customization cu ON (cu.id_cart = o.id_cart) LEFT JOIN ps_customized_data cd ON (cd.id_customization = cu.id_customization) GROUP BY d.id_order ORDER BY d.id_order DESC Link to comment Share on other sites More sharing options...
Nice-side Posted December 15, 2022 Author Share Posted December 15, 2022 Personne pour filer un coup de main? Link to comment Share on other sites More sharing options...
Mediacom87 Posted December 15, 2022 Share Posted December 15, 2022 Bonjour, les numéros sont stockés dans la table ps_address avec les champs phone et phone_mobile Link to comment Share on other sites More sharing options...
Mediacom87 Posted December 15, 2022 Share Posted December 15, 2022 Faites attention, vous renseignez address_delivery et address_invoice avec les mêmes données Link to comment Share on other sites More sharing options...
Nice-side Posted December 15, 2022 Author Share Posted December 15, 2022 Bonjour merci j'avais vu mais je ne sais pas comment l'écrire.... Link to comment Share on other sites More sharing options...
doekia Posted December 15, 2022 Share Posted December 15, 2022 ajouter a.phone_mobile et/ou ab.phone_mobile dans la requête avant le FROM. chaque champ de cette liste doit être encadré de , sauf le dernier avant le FROM Link to comment Share on other sites More sharing options...
Nice-side Posted December 15, 2022 Author Share Posted December 15, 2022 Ok merci je vais essayer. Link to comment Share on other sites More sharing options...
Nice-side Posted December 15, 2022 Author Share Posted December 15, 2022 Merci cela fonctionne mais je n'ai que 1/5 des mes numéros de téléphone qui apparaissent j'ai bien utilisé les deux termes a.phone_mobile et/ou ab.phone_mobile iln'y a que ab.phone_mobile qui affiche quelque chose. Link to comment Share on other sites More sharing options...
Nice-side Posted December 15, 2022 Author Share Posted December 15, 2022 Ok c'est tout bon merci pour le coup de main 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