1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| SELECT DISTINCT p.products_image, m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF( s.status, s.specials_new_products_price, NULL ) AS specials_new_products_price, IF( s.status, s.specials_new_products_price, p.products_price ) AS final_price
FROM products p
LEFT JOIN manufacturers m
USING ( manufacturers_id )
LEFT JOIN specials s ON p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c
WHERE p.products_status = '1'
AND p.products_id = pd.products_id
AND pd.language_id = '4'
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id
AND (
(
pd.products_name LIKE '%a%'
OR p.products_model LIKE '%a%'
OR m.manufacturers_name LIKE '%a%'
)
)
ORDER BY pd.products_name
LIMIT 0 , 50 |
Partager