【发布时间】:2014-02-17 21:32:36
【问题描述】:
我有以下代码
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('sku')
->addAttributeToSelect('name')
->addAttributeToSelect('category_ids')
->addAttributeToSelect('manufacturer')
->addAttributeToSelect('price')
->addAttributeToSelect('special_price')
->addAttributeToSelect('regularprice')
->addAttributeToSelect('tier_price_for_bundle')
->addAttributeToSelect('special_from_date')
->addAttributeToSelect('special_to_date')
->addAttributeToFilter('type_id', array('in' => array('simple')))
->addAttributeToFilter('updated_at', array('from'=>date("Y-m-d", time()-86400)));
->addAttributeToFilter('created_at', array('from'=>date("Y-m-d", time()-86400)));
我想在下面为 updated_at 和 created_at 添加 OR 条件
->addAttributeToFilter('updated_at', array('from'=>date("Y-m-d", time()-86400)));
->addAttributeToFilter('created_at', array('from'=>date("Y-m-d", time()-86400)));
因此,无论产品是创建还是更新,我的收藏都应该加载。
我该怎么做?
【问题讨论】:
标签: magento magento-1.7