Bartas1401 Posted May 27, 2021 Share Posted May 27, 2021 (edited) Witam. Potrzebuję wygenerować plik z historią zamówień w którym znajdzie się imię i nazwisko klienta, co kupił oraz datę sprzedaży. Jest ktoś w stanie pomóc? Edited May 29, 2021 by Bartas1401 (see edit history) Link to comment Share on other sites More sharing options...
krzysiek_web Posted May 27, 2021 Share Posted May 27, 2021 Standardowa opcja exportu nie spełnia twoich oczekiwań? Link to comment Share on other sites More sharing options...
Bartas1401 Posted May 27, 2021 Author Share Posted May 27, 2021 (edited) W standardowej opcji nie generuje mi co klient zamówił. Tak wygląda zapytanie. SELECT CONCAT(LEFT(cu.`firstname`, 1), '. ', cu.`lastname`) AS `customer`, o.id_order, o.reference, o.total_paid_tax_incl, os.paid, osl.name AS osname, o.id_currency, cur.iso_code, o.current_state, o.id_customer, cu.`id_customer` IS NULL as `deleted_customer`, os.color, o.payment, s.name AS shop_name, o.date_add, cu.company, cl.name AS country_name, o.invoice_number, o.delivery_number, IF ((SELECT so.id_order FROM pr_orders so WHERE (so.id_customer = o.id_customer) AND (so.id_order < o.id_order) LIMIT 1) > 0, 0, 1) AS new FROM pr_orders o LEFT JOIN pr_customer cu ON o.id_customer = cu.id_customer LEFT JOIN pr_currency cur ON o.id_currency = cur.id_currency INNER JOIN pr_address a ON o.id_address_delivery = a.id_address LEFT JOIN pr_order_state os ON o.current_state = os.id_order_state LEFT JOIN pr_shop s ON o.id_shop = s.id_shop INNER JOIN pr_country c ON a.id_country = c.id_country INNER JOIN pr_country_lang cl ON c.id_country = cl.id_country AND cl.id_lang = 2 LEFT JOIN pr_order_state_lang osl ON os.id_order_state = osl.id_order_state AND osl.id_lang = 2 WHERE o.`id_shop` IN ('1') ORDER BY o.id_order DESC LIMIT 50 Edited May 27, 2021 by Bartas1401 (see edit history) Link to comment Share on other sites More sharing options...
ComGrafPL Posted May 27, 2021 Share Posted May 27, 2021 11 hours ago, Bartas1401 said: W standardowej opcji nie generuje mi co klient zamówił. Tak wygląda zapytanie. SELECT CONCAT(LEFT(cu.`firstname`, 1), '. ', cu.`lastname`) AS `customer`, o.id_order, o.reference, o.total_paid_tax_incl, os.paid, osl.name AS osname, o.id_currency, cur.iso_code, o.current_state, o.id_customer, cu.`id_customer` IS NULL as `deleted_customer`, os.color, o.payment, s.name AS shop_name, o.date_add, cu.company, cl.name AS country_name, o.invoice_number, o.delivery_number, IF ((SELECT so.id_order FROM pr_orders so WHERE (so.id_customer = o.id_customer) AND (so.id_order < o.id_order) LIMIT 1) > 0, 0, 1) AS new FROM pr_orders o LEFT JOIN pr_customer cu ON o.id_customer = cu.id_customer LEFT JOIN pr_currency cur ON o.id_currency = cur.id_currency INNER JOIN pr_address a ON o.id_address_delivery = a.id_address LEFT JOIN pr_order_state os ON o.current_state = os.id_order_state LEFT JOIN pr_shop s ON o.id_shop = s.id_shop INNER JOIN pr_country c ON a.id_country = c.id_country INNER JOIN pr_country_lang cl ON c.id_country = cl.id_country AND cl.id_lang = 2 LEFT JOIN pr_order_state_lang osl ON os.id_order_state = osl.id_order_state AND osl.id_lang = 2 WHERE o.`id_shop` IN ('1') ORDER BY o.id_order DESC LIMIT 50 Zobacz prywatną wiadomość. 1 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