Jump to content

Ajouter champ numéro de téléphone requête SQL


Nice-side

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...