Подскажите, пожалуйста.
Нужно организовать выборку элементов ИС по нескольким доп свойствам, получается сделать выбору по одному доп свойству, с двумя - не работает
$oInformationsystemItem = Core_Entity::factory('Informationsystem_item');
$oInformationsystemItem
->queryBuilder()
->select('informationsystem_items.*')
->where('informationsystem_items.informationsystem_id', '=', 12)
->where('informationsystem_items.active', '=', 1)
->where('informationsystem_items.deleted', '=', 0)
->leftJoin('informationsystem_item_properties', 'informationsystem_items.informationsystem_id', '=', 'informationsystem_item_properties.informationsystem_id')
->leftJoin('property_value_ints', 'informationsystem_items.id', '=', 'property_value_ints.entity_id',
array(array('AND' => array('informationsystem_item_properties.property_id', '=', Core_QueryBuilder::expression('`property_value_ints`.`property_id`'))))
)
// Первое условие
->where('informationsystem_item_properties.property_id', '=', 34) // id доп.свойства siteuserID
->where('property_value_ints.value', '=', 152) // значение доп.свойства
// Второе условие (не работает)
->where('informationsystem_item_properties.property_id', '=', 39) // id доп.свойства notice
->where('property_value_ints.value', '=', NULL) // значение доп.свойства
//->having(Core_Querybuilder::expression('COUNT(DISTINCT `informationsystem_item_properties`.`property_id`)'), '=', 1)
->groupBy('informationsystem_items.id');
$aInformationsystemItems = $oInformationsystemItem->findAll();