21 lines
695 B
SQL
21 lines
695 B
SQL
SELECT DISTINCT
|
|
p.id as productId,
|
|
pl.lang,
|
|
pl.slug,
|
|
pr.uri as image,
|
|
pr.width as imageWidth,
|
|
pr.height as imageHeight,
|
|
pts.price,
|
|
pts.price_promotional as pricePromotional,
|
|
pl.title,
|
|
pl.short_title as shortTitle,
|
|
pl.description
|
|
-- pl.content, pl.heading_title as headingTitle, pl.instruction
|
|
FROM products p
|
|
JOIN categories_on_products cop ON p.id = cop.product_id
|
|
JOIN product_locale pl ON pl.product_id = p.id
|
|
JOIN product_to_store pts ON pts.product_id = p.id AND pts.store_id = cop.store_id
|
|
LEFT JOIN product_resources pr ON p.id = pr.product_id AND pr.isFeature = TRUE
|
|
WHERE cop.store_id = 1 AND pl.lang = ?
|
|
ORDER BY p.id DESC;
|