$this->getCollection()->addFieldToSelect('couponsunique_id');
$this->getCollection()->getSelect()->joinLeft(array('C' => 'coupons_code_log'), 'main_table.couponsunique_id = C.coupon_parent_id');
$this->getCollection()->getSelect()->group('C.coupon_parent_id');
$this->getCollection()->getSelect()->having('count(couponslog_id) = ?', $value);
protected function _supplierFilter($collection, $column)
{
$value = $column->getFilter()->getValue();
if (!$value):
return $this;
else:
$this->getCollection()->addFieldToSelect('couponsunique_id');
$this->getCollection()->getSelect()->joinLeft(array('C' => 'coupons_code_log'), 'main_table.couponsunique_id = C.coupon_parent_id');
$this->getCollection()->getSelect()->group('C.coupon_parent_id');
$this->getCollection()->getSelect()->having('count(couponslog_id) = ?', $value);
endif;
return $this;
}
$this->addColumn('count', array(
'header' => Mage::helper('couponsunique')->__('Count'),
'align' =>'left',
'index' => 'couponsunique_id',
'filter_condition_callback' => array($this, '_supplierFilter'),
'renderer' => 'Magenext_Couponsunique_Block_Renderer_Count'
));
$this->getCollection()->getSelect()->joinLeft(array('C' => 'coupons_code_log'), 'main_table.couponsunique_id = C.coupon_parent_id');
$this->getCollection()->getSelect()->group('C.coupon_parent_id');
$this->getCollection()->getSelect()->having('count(couponslog_id) = ?', $value);
protected function _supplierFilter($collection, $column)
{
$value = $column->getFilter()->getValue();
if (!$value):
return $this;
else:
$this->getCollection()->addFieldToSelect('couponsunique_id');
$this->getCollection()->getSelect()->joinLeft(array('C' => 'coupons_code_log'), 'main_table.couponsunique_id = C.coupon_parent_id');
$this->getCollection()->getSelect()->group('C.coupon_parent_id');
$this->getCollection()->getSelect()->having('count(couponslog_id) = ?', $value);
endif;
return $this;
}
$this->addColumn('count', array(
'header' => Mage::helper('couponsunique')->__('Count'),
'align' =>'left',
'index' => 'couponsunique_id',
'filter_condition_callback' => array($this, '_supplierFilter'),
'renderer' => 'Magenext_Couponsunique_Block_Renderer_Count'
));
Comments
Post a Comment
Feel Free To Ask...