Magento的collection过滤某个字段为空的语法为:
Mage::getModel()->getCollection()->addFieldToFilter("field","array("null"=>true)");
如果不为空,把true写成false不就行了嘛?答案是错误的,具体的写法如下:
Mage::getModel()->getCollection()->addFieldToFilter("field","array("notnull"=>true)");
也就是把null改为notnull