Здравствуйте!
Подскажите, как корректно сделать ограничение производителей по текущей группе товаров? Чтобы при переходе в определенную группу оставались только те производители, товары которых присутствуют в данной группе.
// Список производителей
$oShop_Producers = $oShop->Shop_Producers;
$oShop_Producers->queryBuilder()
->select('shop_producers.*')
->distinct()
->join('shop_items','shop_items.shop_producer_id','=','shop_producers.id')
->where('shop_items.shop_group_id','=',0)
->where('shop_items.modification_id','>',0)
->where('shop_items.end_datetime','>',Core_Date::timestamp2sql(time()))
->where('shop_items.deleted','=',0);
$aShop_Producers = $oShop_Producers->findAll();
foreach ($aShop_Producers as $oShop_Producer)
{
// Добавляем производителя потомком XML-сущности
$oProducersXmlEntity->addEntity(
$oShop_Producer->clearEntities()
);
}