8 (8482) 61-28-27
Заказать обратный звонок
string(2580) " SELECT shop_nomenclature.shop_nomenclature_id AS shop_nomenclature_id, shop_nomenclature.shop_nomenclature_name AS shop_nomenclature_name, shop_nomenclature.shop_nomenclature_url AS shop_nomenclature_url, shop_nomenclature.shop_nomenclature_image_1 AS shop_nomenclature_image_1, shop_nomenclature.shop_nomenclature_image_alt_1 AS shop_nomenclature_image_alt_1, shop_nomenclature.shop_nomenclature_image_2 AS shop_nomenclature_image_2, shop_nomenclature.shop_nomenclature_image_alt_2 AS shop_nomenclature_image_alt_2, shop_nomenclature.shop_nomenclature_group_id AS shop_nomenclature_group_id, shop_nomenclature.shop_nomenclature_without_availability AS shop_nomenclature_without_availability, MAX(shop_price_nomenclature.shop_price_nomenclature_value) AS shop_price_nomenclature_value_max, MIN(shop_price_nomenclature.shop_price_nomenclature_value) AS shop_price_nomenclature_value_min, coalesce((select sum(shop_availability_nomenclature_count) from shop_availability_nomenclature where shop_availability_nomenclature.shop_nomenclature_id = shop_nomenclature.shop_nomenclature_id) ,0) - coalesce((select sum(shop_reserve_nomenclature_count) from shop_reserve_nomenclature where shop_reserve_nomenclature.shop_nomenclature_id = shop_nomenclature.shop_nomenclature_id),0) AS shop_availability_nomenclature_count FROM shop_nomenclature, shop_price_nomenclature , shop_nomenclature_property WHERE shop_nomenclature.shop_nomenclature_delete= FALSE AND shop_nomenclature.shop_nomenclature_id=shop_price_nomenclature.shop_nomenclature_id AND shop_nomenclature.shop_nomenclature_id=shop_nomenclature_property.shop_nomenclature_id AND shop_nomenclature_property.shop_property_id in (15) AND shop_price_nomenclature.shop_price_nomenclature_value between '0' and '5000' GROUP BY shop_nomenclature.shop_nomenclature_id, shop_price_nomenclature.shop_nomenclature_id ORDER BY coalesce((select sum(shop_availability_nomenclature_count) from shop_availability_nomenclature where shop_availability_nomenclature.shop_nomenclature_id = shop_nomenclature.shop_nomenclature_id) ,0) - coalesce((select sum(shop_reserve_nomenclature_count) from shop_reserve_nomenclature where shop_reserve_nomenclature.shop_nomenclature_id = shop_nomenclature.shop_nomenclature_id),0) DESC, shop_price_nomenclature_value_min ASC LIMIT 16 OFFSET 0 "