В общем когда пишу вот так:
$count_condition = 0;
$element = array ();
$element['type'] = 1;
$element['property_id'] = 133;
//$element['prefix'] = 'AND';
$element['prefix'] = '';
$element['if'] = '!=';
$element['value'] = '';
$element['sufix']=" AND shop_list_of_properties_table.shop_list_of_properties_id='133' AND (REPLACE (shop_properties_items_table.shop_properties_items_value, ',', '.') + 0.0) >= ".to_int ($_GET['height_from'])." AND (REPLACE (shop_properties_items_table.shop_properties_items_value, ',', '.') + 0.0) <= ".to_int ($_GET['height_to']);
$param['select'][]=$element; // Указываем очередное ограничение, введенное выше
$count_condition++;
$element = array ();
$element['type']=1; // 0 — основное св-во, 1 — дополнительное
$element['property_id'] = 139; // ID дополнительного св-ва, указывается если тип = 1
$element['prefix'] = 'AND'; // префикс
$element['if'] = '!='; // Условие
$element['value'] = '';
$element['sufix']=" AND shop_list_of_properties_table.shop_list_of_properties_id='139' AND (REPLACE (shop_properties_items_table.shop_properties_items_value, ',', '.') + 0.0) >= ".to_int ($_GET['max_weight']);
$param['select'][]=$element; // Указываем очередное ограничение, введенное выше
$count_condition++;
Получается такой запрос:
SELECT SQL_CALC_FOUND_ROWS DISTINCT shop_items_catalog_table.shop_items_catalog_item_id FROM shop_items_catalog_table LEFT JOIN shop_list_of_properties_table
ON shop_items_catalog_table.shop_shops_id = shop_list_of_properties_table.shop_shops_id
LEFT JOIN shop_properties_items_table
ON shop_items_catalog_table.shop_items_catalog_item_id = shop_properties_items_table.shop_items_catalog_item_id
AND shop_properties_items_table.shop_list_of_properties_id = shop_list_of_properties_table.shop_list_of_properties_id WHERE shop_items_catalog_table.shop_items_catalog_is_active = '1' AND shop_items_catalog_table.shop_items_catalog_modification_id = '0' AND shop_items_catalog_table.shop_items_catalog_access IN(0,-1) AND shop_items_catalog_table.shop_shops_id='1' AND (shop_items_catalog_table.shop_items_catalog_putend_date >= '2009-06-08 10:29:01' OR shop_items_catalog_table.shop_items_catalog_putend_date ='0000-00-00 00:00:00') AND shop_items_catalog_table.shop_items_catalog_putoff_date <= '2009-06-08 10:29:01' and ( shop_list_of_properties_table.shop_list_of_properties_id=133 AND shop_properties_items_table.shop_properties_items_value != AND shop_list_of_properties_table.shop_list_of_properties_id='133' AND (REPLACE (shop_properties_items_table.shop_properties_items_value, ',', '.') + 0.0) >= 0 AND (REPLACE (shop_properties_items_table.shop_properties_items_value, ',', '.') + 0.0) <= 0 AND shop_list_of_properties_table.shop_list_of_properties_id=139 AND shop_properties_items_table.shop_properties_items_value != AND shop_list_of_properties_table.shop_list_of_properties_id='139' AND (REPLACE (shop_properties_items_table.shop_properties_items_value, ',', '.') + 0.0) >= 0 ) AND shop_items_catalog_table.shop_shops_id = '1' HAVING 1 ORDER BY shop_items_catalog_table.shop_items_catalog_order Asc, shop_items_catalog_table.shop_items_catalog_name Asc LIMIT 0, 3","4","-","http://matras/select/","127.0.0.1"