我正试图在我的magento商店上展示最新产品。我如何订购Magento的最新产品?
什么是近期产品?它由两个标准定义:
- created_at
- news_from_date
我想订created_at & news_from_date之间漠然我的产品,而不是一个标准的第一个,第二个后。
任何想法?
我已经尝试下面的代码:
->addAttributeToSort('created_at, news_from_date', 'desc')
OR
->addAttributeToSort('news_from_date', 'desc')
->addAttributeToSort('created_at', 'desc')
OR
->addAttributeToSort(array('created_at' => 'desc', 'news_from_date' => 'desc'))
OR
->addAttributeToSort(array('created_at', 'news_from_date'), 'desc'))
什么左边是什么意思? – 2011-03-21 20:16:26
'左'表示左加入。 addAttributeToFilter的最后一个参数是连接类型。 – 2011-03-22 04:27:45