Magento获得最后登录

时间:2010-12-23 08:33:49

标签: php session magento login

如何在Magento中获取最后的登录详细信息,因为我没有使用此代码获取任何内容:

->joinTable('log/customer', 'customer_id=entity_id', array('logout_at'));

2 个答案:

答案 0 :(得分:1)

尝试使用左连接

$collection->getSelect()->joinLeft(array('lc' => 'log_customer'), 'e.customer_id = lc.customer_id', array('logout_at' => 'logout_at'));

e.customer_id may in this case be main_table.customer_id

e.entity_id may in this case be main_table.entity_id

答案 1 :(得分:0)

使用以下代码段获取登录客户:

Mage::getSingleton('customer/session')->getCustomer();