【发布时间】:2017-07-23 11:44:33
【问题描述】:
当我得到产品集合时:
$collection = Mage::getModel('catalog/product')->getCollection();
我得到一个 group_price 键,但它是空的。 (产品有 group_price)
Array
(
[entity_id] => 1
[entity_type_id] => 4
[attribute_set_id] => 2
[type_id] => simple
[sku] => 00000
......
[group_price] => Array
(
)
......
)
如果我加载产品,我可以获得 group_price 数据:
$product_id = '1';
$product = Mage::getModel('catalog/product')->load($product_id);
$group_price = $product->getData('group_price');
我尝试使用 join() 或 joinTable() 或 joinLeft() 对表 'catalog_product_entity_group_price' 进行不同的查询,但没有成功。
如何通过连接查询将 group_price 数据加入集合?
我想避免迭代集合来加载每个产品并获取 group_price。
【问题讨论】: