【发布时间】:2011-05-17 11:44:43
【问题描述】:
我需要查询订单发货集合 (Mage_Sales_Model_Mysql4_Order_Shipment_Collection)。我只想查看已写入与某段文本匹配的评论的订单发货。
在非 EAV SQL 中,它看起来像这样:
SELECT shipments.id
FROM shipments
JOIN comments ON (
shipments.id = comments.shipment_id
AND comments.content IN('Possible comment', 'Another possible comment')
)
GROUP BY shipments.id
显然我想使用 Magento 的原生模型方法来完成它:
$shipments = Mage::getResourceModel('sales/order_shipment_collection')
->addAttributeToSelect('*')
// ??
// ??
->load();
这可能吗?
【问题讨论】:
标签: php collections magento