我工作的Magento的项目,我需要根据国家的英明等,其中country ="Nepal"
magento getCollection()我们可以放哪里条件?
我们可以发送WHERE条件中getCollection()
功能
$collection = Mage::getModel('relocator/location')->getCollection();
任何帮助将不胜感激选择地址来获取值
我工作的Magento的项目,我需要根据国家的英明等,其中country ="Nepal"
magento getCollection()我们可以放哪里条件?
我们可以发送WHERE条件中getCollection()
功能
$collection = Mage::getModel('relocator/location')->getCollection();
任何帮助将不胜感激选择地址来获取值
得到了解决 ,P
Mage::getModel('relocator/location')
->getCollection()
->addFilter('country','Nepal');
您可以使用不同势条件如下面参考从this.
$collection = Mage::getModel('catalog/product')->getCollection();
等于
$collection->addAttributeToFilter('status', array('eq' => 1));
大于
$collection->addAttributeToFilter('price', array('gt' => 3));
包含 - 以%通配符 是NULL
$collection->addAttributeToFilter('sku', array('like' => 'DVD%'));
$ collection-> addAttributeToFilter('entity_id',array('nin'=> array(1,2,12)));
真是太棒了! – 2017-01-20 15:22:25