使用finset的magento过滤器集合



我试图在magento集合上使用find_in_set,但使用它时遇到问题,如何使用finset从多个id 中筛选记录

//i.e $cat_ids = array(16,17); this doesnt work
//i.e $cat_ids = array(16);  this works

下面是我正在进行过滤的集合

$collection = Mage::getModel('catalog/product')->getCollection();
                $collection->addAttributeToSelect('*')
                ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left outer')
                ->addAttributeToFilter('category_id', array(
                     array('finset' => $cat_ids),
                ));

您是否尝试过使用in而不是finset?

最新更新