How can I get last login details in Magen开发者_运维百科to, as I am not getting anything using this code:
->joinTable('log/customer', 'customer_id=entity_id', array('logout_at'));
Try using left join instead
$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
or
e.entity_id may in this case be main_table.entity_id
Use the following snippet to get the logged in customer:
Mage::getSingleton('customer/session')->getCustomer();
精彩评论