magento join

piaoling  2011-07-27 14:09:45

$collection = Mage::getModel('catalog/product')->getCollection()->setStoreId($storeId)
                      ->addAttributeToSelect("*");

$collection->getSelect()->join(array('cat_index'=>'catalog_category_product_index'),"cat_index.product_id=e.entity_id and cat_index.store_id='$storeId' AND cat_index.category_id in ($catsString)",array('*'));

 

more details :http://stackoverflow.com/questions/3949470/how-to-select-specific-fields-with-aliases-using-jointable-or-joinfield-in-magent

类别 :  magento(258)  |  浏览(3556)  |  评论(0)
发表评论(评论将通过邮件发给作者):

Email: