更新时间:2023-11-30 10:14:04
从getSelect()
和join()
返回的类型是选择对象,而不是addStoreFilter()
和addIsActiveFilter()
所属的集合.选择部分需要出现在链的后面:
The returned type from getSelect()
and join()
is a select object, not the collection that addStoreFilter()
and addIsActiveFilter()
belong to. The select part needs to occur later in the chain:
$collection = Mage :: getModel('flagbit_faq/faq')->getCollection()
->addStoreFilter(Mage :: app()->getStore())
->addIsActiveFilter();
// Cannot append getSelect right here because $collection will not be a collection
$collection->getSelect()
->join(array('t2' => $tbl_faq_item),'main_table.faq_id = t2.faq_id','t2.category_id');