且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在一页中从两个模型获取数据-Magento

更新时间:2023-11-30 08:43:40

在这里,也许试试看?同样,我不确定这是否行得通,但我认为它的方向正确.

Here, maybe try this? Again I'm not sure if this will work, but I think its in the right direction.

<?php 

$collection1 = Mage::getModel('customer/customer')->getCollection();
$collection2 = Mage::getModel('customer/address')->getCollection();

$merged_ids = array_merge($collection1->getAllIds(), $collection2->getAllIds());

$merged_collection = Mage::getResourceModel('customer/customer_collection')
    ->addFieldToFilter('customer_id', $merged_ids)
    ->addAttributeToSelect('*')
    ->addStoreFilter();


?>