getCollection();
$eavAttributeTable = Mage::getSingleton('core/resource')->getTableName('eav/attribute');
$categoryEntityVarcharTable = (string)Mage::getConfig()->getTablePrefix() . 'catalog_category_entity_varchar';
$collection->addAttributeToSelect('name');
$collection->getSelect()->join(array('cev'=>$categoryEntityVarcharTable), 'cev.entity_id = e.entity_id', array())
->join(array('ea'=>$eavAttributeTable), 'cev.attribute_id= ea.attribute_id', array())
->where("cev.value='Root Catalog'");
$collection = $collection->load();
foreach($collection AS $category) {
echo $category->getName();
}
?>
Magento 非实体模型访问
最新推荐文章于 2019-04-08 00:36:00 发布
本文介绍了一种使用Magento框架查询特定名称为'RootCatalog'的类别的方法。通过加载核心资源模型并设置SQL连接,实现了从实体变化表中选择名称属性,并通过连接查询的方式筛选出所需的根目录类别。
790

被折叠的 条评论
为什么被折叠?



