Magento过滤器收集的创建时间(今天,昨天,星期,小时等)
我有一个自定义集合,希望按创建日期和“昨天”创建的het条目进行过滤 馆藏条目 //dates are set in controller using setCreatedTime(Mage::getModel('core/date')->gmtDate()); 昨天创建(无效) //3 products items Yesterday //below filtering outputs incorrect entries $collection = Mage::getModel('things/things')->getCollection(); 我试过了,但是输出不正确; //thought strtotime('yesterday') would work.. $collection->addFieldToFilter('created_time', array('gt' => Mage::getModel('core/date')->date('Y-m-d H:i:s', strtotime('yesterday')))); $collection->addFieldToFilter('created_time', array('gt' => Mage::getModel('core/date')->date('Y-m-d H:i:s', strtotime('-1 day')))); $collection->addFieldToFilter('created_time', array('from'=> strtotime('-1 day', time()),'to'=> time(),'datetime' => true)); $fromDate = …