Нет, не получаеться, добавляю
$element['property_id'] = '';
$element['type'] = 1;
$element['prefix'] = ' AND';
$element['if'] = '';
$element['value'] = '';
$element['sufix'] = " shop_prices_to_item_table.shop_list_of_prices_id='". $element['property_id'] ."' AND shop_prices_to_item_table.shop_items_catalog_item_id=shop_items_catalog_table.shop_items_catalog_item_id";
$param['select'][] = $element;
Получаеться запрос
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
LEFT JOIN shop_item_discount_table
ON shop_item_discount_table.shop_items_catalog_item_id = shop_items_catalog_table.shop_items_catalog_item_id
LEFT JOIN shop_discount_table ON
shop_discount_table.shop_discount_id = shop_item_discount_table.shop_discount_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='3' AND shop_item_discount_table.shop_discount_id IN (3) AND (shop_items_catalog_table.shop_items_catalog_putend_date >= '2011-04-08 16:38:39' 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 <= '2011-04-08 16:38:39'
AND shop_list_of_properties_table.shop_list_of_properties_id=4
AND shop_properties_items_table.shop_properties_items_value shop_prices_to_item_table.shop_list_of_prices_id=4
AND shop_prices_to_item_table.shop_items_catalog_item_id=shop_items_catalog_table.shop_items_catalog_item_id
ORDER BY Rand() LIMIT 0, 36
не хватает LEFT JOIN shop_prices_to_item_table, как это можно решить?