Asog Posted April 29, 2021 Share Posted April 29, 2021 Bonjour à tous, J'aurai besoin pour mon site d'extraire via requete sql, la liste de mes commandes avec le n° de suivi transporteur et le nom du transporteur. Pour l'instant je suis partie de la requête commande ci dessous sur laquelle j'ai besoin d'indiquer/rajouter le N° de suivi qui se trouve dans la table : ps_order_carrier / tracking_number pouvez vous m'aider svp ? je ne sais pas les intégrer cela bug tout le temps quand je teste qqch. SELECT SQL_CALC_FOUND_ROWS a.`id_order`, a.`reference`, a.`total_paid_tax_incl`, a.`payment`, a.`date_add` AS `date_add`, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) AS `customer`, osl.`name` AS `osname`, IF((SELECT so.id_order FROM `ps_orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new, country_lang.name as cname, IF(a.valid, 1, 0) badge_success, shop.`name` AS shop_name, po.`product_id` AS product_id, po.`product_attribute_id` AS product_attribute_id, p.`reference` AS product_reference, pa.`reference` AS attr_reference, pa.`ean13` AS EAN, pa.`upc` AS UPC, po.`product_quantity` AS Quantity FROM `ps_orders` a LEFT JOIN `ps_customer` c ON (c.`id_customer` = a.`id_customer`) INNER JOIN `ps_address` address ON address.id_address = a.id_address_delivery INNER JOIN `ps_country` country ON address.id_country = country.id_country INNER JOIN `ps_country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = 1) LEFT JOIN `ps_order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `ps_order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 1) LEFT JOIN `ps_axgtm_ga` gtm ON (a.`id_order` = gtm.`id_order`) LEFT JOIN `ps_shop` shop ON (a.`id_shop` = shop.`id_shop`) LEFT JOIN `ps_order_detail` po ON (po.`id_order` = a.`id_order`) LEFT JOIN `ps_product_attribute` pa ON (pa.`id_product` = po.`product_id`) LEFT JOIN `ps_product` p ON (p.`id_product` = po.`product_id`) WHERE 1 AND a.id_shop IN (1) ORDER BY a.id_order DESC 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