Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT d.id_order AS 'ID ordine', o.reference AS 'Rif. ordine', os.name AS 'Stato', o.date_upd AS 'Data ordine', d.product_name AS 'Prodotto', d.product_reference AS 'Cod. Rif.', d.product_quantity AS 'Qt.', s.quantity AS 'In stock', d.product_price AS 'Prezzo', o.payment AS 'Pagamento', CONCAT_WS( ' ', g.firstname, g.lastname ) AS 'Cliente', CONCAT_WS(' ', ad.address1, ad.address2, ad.postcode, ad.city, ad.other, ad.phone, ad.phone_mobile) AS 'Spedizione', CONCAT_WS(' ', ai.address1, ai.address2, ai.postcode, ai.city, ai.other, ai.phone, ai.phone_mobile) AS 'Fatturazione', g.email AS 'Email', gl.name AS 'Gruppo'
- 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_stock_available s ON (d.product_id = s.id_product)
- LEFT JOIN ps_address ad ON (o.id_address_delivery = ad.id_address)
- LEFT JOIN ps_address ai ON (o.id_address_invoice = ai.id_address)
- LEFT JOIN ps_group_lang gl ON ( g.id_default_group = gl.id_group )
- LEFT JOIN ps_order_state_lang os ON ( o.current_state = os.id_order_state )
- WHERE os.id_lang =1
- GROUP BY d.id_order, d.product_name
- ORDER BY d.id_order DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement