Untitled

mail@pastecode.io avatar
unknown
mysql
2 years ago
806 B
3
Indexable
Never
SELECT
                p.id,
                p.product_code,
                lang.slug,
                pl.name,
                pl.vat,
                product_lang.raw_description,
                    (SELECT name FROM manufacturers m WHERE m.id = p.manufacturer_id) AS manufacturer_name,
                pl.packing_size,
                @price := getClientPrice2(1, pl.code, 1, 0) AS price,
                (SELECT c.currency FROM clients AS c WHERE c.external_id = 1 LIMIT 1) AS currency
            FROM
                product_lanes pl
            LEFT JOIN
                product p ON p.product_code = pl.code
			LEFT JOIN
                lang ON lang.is_default = 1
			LEFT JOIN
				product_lang ON product_lang.product_id = p.id AND product_lang.lang_id = lang.id
            LIMIT 1000 OFFSET 0;