Здравствуйте!
Подскажите, пожалуйста, что я делаю не так для того, что бы корректно работал фильтр по продавцам (аналогично фильтру по производителям).
В ТДС добавляю:
перед
// Producers
if (Core_Array::getGet('producer_id'))
// Sellers
if (Core_Array::getGet('seller_id'))
{
$isellerId = intval(Core_Array::getGet('seller_id'));
$Shop_Controller_Show->addEntity(
Core::factory('Core_Xml_Entity')
->name('seller_id')->value($isellerId)
);
$Shop_Controller_Show->shopItems()
->queryBuilder()
->select('shop_items.*')
->leftJoin(array('shop_items', 'sh1'), 'sh1.modification_id', '=', 'shop_items.id')
->open()
->where('shop_items.shop_seller_id', '=', $isellerId)
->setOr()
->where('sh1.shop_seller_id', '=', $isellerId)
->close()
->groupBy('shop_items.id');
$Shop_Controller_Show->addCacheSignature('seller_id=' . $isellerId);
}
Затем перед
/* Производители */
$oShop = $Shop_Controller_Show->getEntity();
/* Продавцы */
$oShop = $Shop_Controller_Show->getEntity();
// XML-сущность, к которй будут добавляться производители
$osellersXmlEntity = Core::factory('Core_Xml_Entity')->name('sellers');
// Добавляем XML-сущность контроллеру показа
$Shop_Controller_Show->addEntity($osellersXmlEntity);
// Список производителей
$oShop_sellers = $oShop->Shop_sellers;
$oShop_sellers->queryBuilder()
->select('shop_sellers.*')
->distinct()
->join('shop_items', 'shop_items.shop_seller_id', '=', 'shop_sellers.id')
->where('shop_items.shop_group_id', '=', $Shop_Controller_Show->group)
->where('shop_items.deleted', '=', 0);
$aShop_sellers = $oShop_sellers->findAll();
foreach ($aShop_sellers as $oShop_seller)
{
// Добавляем производителя потомком XML-сущности
$osellersXmlEntity->addEntity(
$oShop_seller->clearEntities()
);
}
В итоге в XML продавцы не выводятся списком:
<sellers></sellers>