예제 #1
0
파일: Grid.php 프로젝트: xiaoguizhidao/beut
 protected function _prepareCollection()
 {
     // Get collection of synchronizations
     $collection = Mage::getModel('M2ePro/Account')->getCollection();
     $components = Mage::helper('M2ePro/Component')->getActiveComponents();
     $collection->addFieldToFilter('main_table.component_mode', array('in' => $components));
     // Set collection to grid
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
예제 #2
0
파일: Grid.php 프로젝트: xiaoguizhidao/beut
 protected function _prepareCollection()
 {
     // Get collection of prices templates
     $collection = Mage::getModel('M2ePro/Template_SellingFormat')->getCollection();
     $components = Mage::helper('M2ePro/Component')->getActiveComponents();
     $collection->addFieldToFilter('main_table.component_mode', array('in' => $components));
     //exit($collection->getSelect()->__toString());
     // Set collection to grid
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
예제 #3
0
파일: Grid.php 프로젝트: xiaoguizhidao/beut
 protected function _prepareCollection()
 {
     // Get collection of general templates
     $collection = Mage::getModel('M2ePro/Template_General')->getCollection();
     $collection->addFieldToFilter('component_mode', array('neq' => Ess_M2ePro_Helper_Component_Amazon::NICK));
     $collection->addFieldToFilter('component_mode', array('neq' => Ess_M2ePro_Helper_Component_Buy::NICK));
     //        exit($collection->getSelect()->__toString());
     // Set collection to grid
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
예제 #4
0
파일: Grid.php 프로젝트: xiaoguizhidao/beut
 protected function _prepareCollection()
 {
     /** @var $collection Mage_Core_Model_Mysql4_Collection_Abstract */
     $collection = Mage::getModel('M2ePro/Order_Log')->getCollection();
     $collection->getSelect()->joinLeft(array('mo' => Mage::getResourceModel('M2ePro/Order')->getMainTable()), '(mo.id = `main_table`.order_id)', array('magento_order_id'));
     $collection->getSelect()->joinLeft(array('so' => Mage::getSingleton('core/resource')->getTableName('sales/order')), '(so.entity_id = `mo`.magento_order_id)', array('magento_order_number' => 'increment_id'));
     $orderId = $this->getRequest()->getParam('order_id');
     if ($orderId) {
         $collection->addFieldToFilter('main_table.order_id', $orderId);
     }
     $components = Mage::helper('M2ePro/Component')->getActiveComponents();
     $collection->addFieldToFilter('main_table.component_mode', array('in' => $components));
     //--------------------------------
     if ($this->getRequest()->getParam('sort', 'create_date') == 'create_date') {
         $collection->setOrder('id', $this->getRequest()->getParam('dir', 'DESC'));
     }
     //--------------------------------
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }