Ejemplo n.º 1
0
 protected function _prepareCollection()
 {
     $collection = Mage::getModel('M2ePro/Account')->getCollection();
     $collection->getSelect()->joinLeft(array('aa' => Mage::getResourceModel('M2ePro/Amazon_Account')->getMainTable()), '(`aa`.`account_id` = `main_table`.`id`)', array('merchant_id'))->joinLeft(array('ba' => Mage::getResourceModel('M2ePro/Buy_Account')->getMainTable()), '(`ba`.`account_id` = `main_table`.`id`)', array('seller_id'))->joinLeft(array('m' => Mage::getResourceModel('M2ePro/Marketplace')->getMainTable()), '(`m`.`id` = `aa`.`marketplace_id`)', array('marketplace_title' => 'title'));
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Ejemplo n.º 2
0
 protected function _prepareCollection()
 {
     // Get collection of accounts
     $collection = Mage::getModel('M2ePro/Account')->getCollection();
     $collection->getSelect()->joinLeft(array('ea' => Mage::getResourceModel('M2ePro/Ebay_Account')->getMainTable()), '(`ea`.`account_id` = `main_table`.`id`)', array('user_id', 'mode'));
     // Set collection to grid
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }