我有一个表,我的自定义模块与下列:加入收藏获取客户名称(管理网格)
---------------
| custom_table|
---------------
| id
| seller_id
| buyer_id
| ...
---------------
seller_id -> customer_enity [entity_id]
buyer_id -> customer_entity [entity_id]
现在我想显示在管理网格布局,卖方名称和买方名称。 我无法弄清楚如何从客户实体中检索卖家姓名和买家姓名。 但我知道如何获取他们的电子邮件为:
protected function _prepareCollection()
{
$collection = Mage::getModel('custommodule/custommodule')->getCollection();
$collection->getSelect()
->join(array('ce1' => 'customer_entity'), 'ce1.entity_id=main_table.seller_id', array('seller_email' => 'email'))
->join(array('ce2' => 'customer_entity'), 'ce2.entity_id=main_table.buyer_id', array('buyer_email' => 'email'));
#echo $collection->getSelect()->__toString();
$this->setCollection($collection);
return parent::_prepareCollection();
}
这上面的代码工作正常。但我想显示他们的名字而不是电子邮件。 任何机构可以帮助我修改这个集合吗?
任何帮助,非常感谢。 感谢