2
我无法在magento教程中找到此问题的解决方案。 如何在自定义模型中实现布尔OR运算符时涉及两个属性?官方教程中的示例仅演示了对一个字段sku使用OR布尔值。Magento上的复杂布尔条件
$filter_a = array('like'=>'a%');
$filter_b = array('like'=>'b%');
Mage::getModel('catalog/product')
->getCollection()
->addFieldToFilter('sku', array($filter_a, $filter_b))
->getSelect();
这相当于
WHERE e.sku like 'a%' or e.sku like 'b%'
但是,如果我需要运行诸如条件是什么:
WHERE (e.sku like 'a%' or e.sku like 'b%') or (table_price.value >= '10')
我怎样才能做到这一点上的Magento?由于
使用OR过滤Magento集合的好资源:http://tweetorials.tumblr.com/post/10844018716/eav-collection-or-filters –