当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection方法代码示例

本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection怎么用?PHP Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Adminhtml_Block_Widget_Grid的用法示例。


在下文中一共展示了Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'zip') {
         $value = $column->getFilter()->getValue();
         if (!is_numeric($value)) {
             $state = addslashes(strtoupper(substr($value, -2)));
             $city = addslashes(substr_replace($value, "", -4));
             $zipArr = Mage::getModel('urls/cities')->getCityZips($city, $state);
             $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
             $this->getCollection()->addAttributeToFilter($field, array('in' => $zipArr));
             return $this;
         }
     }
     // Set custom filter for in category flag
     if ($column->getId() == 'in_category') {
         $productIds = $this->_getSelectedProducts();
         if (empty($productIds)) {
             $productIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', array('in' => $productIds));
         } elseif (!empty($productIds)) {
             $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:29,代码来源:Product.php

示例2: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     // Set custom filter for in product flag
     if ($column->getId() == 'in_products') {
         $productIds = $this->_getSelectedProducts();
         if (empty($productIds)) {
             $productIds = 0;
         }
         $createdProducts = $this->_getCreatedProducts();
         $existsProducts = $productIds;
         // Only for "Yes" Filter we will add created products
         if (count($createdProducts) > 0) {
             if (!is_array($existsProducts)) {
                 $existsProducts = $createdProducts;
             } else {
                 $existsProducts = array_merge($createdProducts);
             }
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', array('in' => $existsProducts));
         } else {
             if ($productIds) {
                 $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:30,代码来源:Grid.php

示例3: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     $filterArr = Mage::registry('preparedFilter');
     if (($column->getId() === 'store_id' || $column->getId() === 'status') && $column->getFilter()->getValue() && strpos($column->getFilter()->getValue(), ',')) {
         $_inNin = explode(',', $column->getFilter()->getValue());
         $inNin = array();
         foreach ($_inNin as $k => $v) {
             if (is_string($v) && strlen(trim($v))) {
                 $inNin[] = trim($v);
             }
         }
         if (count($inNin) > 1 && in_array($inNin[0], array('in', 'nin'))) {
             $in = $inNin[0];
             $values = array_slice($inNin, 1);
             $this->getCollection()->addFieldToFilter($column->getId(), array($in => $values));
         } else {
             parent::_addColumnFilterToCollection($column);
         }
     } elseif (is_array($filterArr) && array_key_exists($column->getId(), $filterArr) && isset($filterArr[$column->getId()])) {
         $this->getCollection()->addFieldToFilter($column->getId(), $filterArr[$column->getId()]);
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:25,代码来源:Grid.php

示例4: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         if ($column->getId() == 'websites') {
             $this->getCollection()->joinField('websites', 'catalog/product_website', 'website_id', 'product_id=entity_id', null, 'left');
         }
     }
     // Set custom filter for in product flag
     if ($column->getId() == 'in_products') {
         $productIds = $this->_getSelectedProducts();
         if (empty($productIds)) {
             $productIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', array('in' => $productIds));
         } else {
             if ($productIds) {
                 $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:beejhuff,项目名称:magento-kick-butt-search,代码行数:25,代码来源:Products.php

示例5: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getIndex() == 'stores') {
         $this->getCollection()->addStoreFilter($column->getFilter()->getCondition(), false);
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:okite11,项目名称:frames21,代码行数:9,代码来源:Pending.php

示例6: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getIndex() == 'popularity') {
         $this->getCollection()->addPopularityFilter($column->getFilter()->getCondition());
         return $this;
     } else {
         return parent::_addColumnFilterToCollection($column);
     }
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:9,代码来源:Grid.php

示例7: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         if ($column->getId() == 'websites') {
             $this->getCollection()->joinField('websites', 'catalog/product_website', 'website_id', 'product_id=entity_id', null, 'left');
         }
     }
     return parent::_addColumnFilterToCollection($column);
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:9,代码来源:Grid.php

示例8: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         if ($column->getId() == 'name') {
             $this->getCollection()->getSelect()->join(array('cpev' => 'catalog_product_entity_varchar'), 'cpev.entity_id = main_table.product_id', array('product_name' => 'value'))->join(array('ea' => 'eav_attribute'), '       cpev.attribute_id = ea.attribute_id')->join(array('eet' => 'eav_entity_type'), 'eet.entity_type_id = ea.entity_type_id')->where('ea.attribute_code = ?', 'name')->where('eet.entity_type_code = ?', 'catalog_product');
         }
     }
     return parent::_addColumnFilterToCollection($column);
 }
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:9,代码来源:Grid.php

示例9: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'serial_codes' && $column->getFilter()->getValue() == '*') {
         $this->getCollection()->addFieldToFilter($column->getId(), array('notnull' => true))->addFieldToFilter($column->getId(), array('neq' => ''));
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:9,代码来源:Grid.php

示例10: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'sku' && $column->getFilter()->getValue()) {
         $this->getCollection()->addFieldToFilter($column->getId(), $column->getFilter()->getValue());
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:9,代码来源:Grid.php

示例11: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
     $skip = array('subtotal', 'customer_name', 'email');
     if (in_array($field, $skip)) {
         return $this;
     }
     parent::_addColumnFilterToCollection($column);
     return $this;
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:10,代码来源:Test.php

示例12: _addColumnFilterToCollection

 /**
  * Filter number of customers column
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Enterprise_CustomerSegment_Block_Adminhtml_Report_Customer_Segment_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'customer_count') {
         if ($column->getFilter()->getValue() !== null) {
             $this->getCollection()->addCustomerCountFilter($column->getFilter()->getValue());
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:17,代码来源:Grid.php

示例13: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'in_products') {
         $value = $column->getFilter()->getValue();
         if ($value == 1) {
             $this->getCollection()->addFieldToFilter('alsoviewed_relation', array('notnull' => true));
         } elseif ($value == 0) {
             $this->getCollection()->addFieldToFilter('alsoviewed_relation', array('null' => true));
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:sidvic09,项目名称:magento-alsoviewed,代码行数:14,代码来源:Relations.php

示例14: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         if ($column->getId() == 'websites') {
             $this->getCollection()->joinField('websites', 'catalog/product_website', 'website_id', 'product_id=entity_id', null, 'left');
         }
         if ($column->getId() == 'ml_published') {
             $this->getCollection()->joinField('published', 'mercadolivre/product', 'published', 'product_id=entity_id', null, 'left');
         }
         if ($column->getId() == 'ml_type') {
             $this->getCollection()->joinField('type', 'mercadolivre/product', 'type', 'product_id=entity_id', null, 'left');
         }
     }
     return parent::_addColumnFilterToCollection($column);
 }
开发者ID:victordamaceno,项目名称:magento-mercadolivre,代码行数:15,代码来源:Grid.php

示例15: _addColumnFilterToCollection

 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'ajax_grid_in_category') {
         $collection = $this->getCollection();
         $selectedNews = $this->getSelectedNews();
         if ($column->getFilter()->getValue()) {
             $collection->addFieldToFilter('news_id', array('in' => $selectedNews));
         } elseif (!empty($selectedNews)) {
             $collection->addFieldToFilter('news_id', array('nin' => $selectedNews));
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
开发者ID:Aleksandr-Kachura,项目名称:magento,代码行数:15,代码来源:News.php


注:本文中的Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。