CODE (SQL):
скопировать код в буфер обмена
скопировать код в буфер обмена
- SELECT SQL_CALC_FOUND_ROWS l.`virtuemart_product_id`
- FROM `cms_virtuemart_products_ru_ru` AS l JOIN `cms_virtuemart_products` AS p USING (`virtuemart_product_id`)
- LEFT JOIN `cms_virtuemart_product_categories`
- ON p.`virtuemart_product_id` = `cms_virtuemart_product_categories`.`virtuemart_product_id`
- LEFT JOIN `cms_virtuemart_categories_ru_ru` AS c
- ON c.`virtuemart_category_id` = `cms_virtuemart_product_categories`.`virtuemart_category_id`
- LEFT JOIN `cms_virtuemart_product_manufacturers`
- ON p.`virtuemart_product_id` = `cms_virtuemart_product_manufacturers`.`virtuemart_product_id`
- LEFT JOIN `cms_virtuemart_manufacturers_ru_ru` AS m
- ON m.`virtuemart_manufacturer_id` = `cms_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id`
- LEFT JOIN `cms_virtuemart_product_shoppergroups`
- ON p.`virtuemart_product_id` = `cms_virtuemart_product_shoppergroups`.`virtuemart_product_id`
- LEFT
- OUTER JOIN `cms_virtuemart_shoppergroups` AS s
- ON s.`virtuemart_shoppergroup_id` = `cms_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id`
- WHERE ((`product_name` LIKE "%GENEVRIER%" OR `product_s_desc` LIKE "%GENEVRIER%" OR `category_name` LIKE "%GENEVRIER%" OR `category_description` LIKE "%GENEVRIER%" OR `mf_name` LIKE "%GENEVRIER%")
- AND p.`published`="1"
- AND ( s.`virtuemart_shoppergroup_id`= "1" OR s.`virtuemart_shoppergroup_id` IS NULL ) )
- GROUP BY p.`virtuemart_product_id`
- ORDER BY product_name ASC
- LIMIT 0, 10