Sunday, December 28, 2014

CDbCriteria addBetweenCondition or filter by date range

// $criteria->addBetweenCondition($column, $valueStart, $valueEnd, 'AND');

$criteria = new CDbCriteria;   
    $criteria->addBetweenCondition('actual_completion_date', $_GET['startdate'], $_GET['enddate'], 'AND');  
 $criteria->group = 'client_id';
      
 $dataProvider = new CActiveDataProvider('SaleInfo', array(
                        'criteria'  =>  $criteria,
                        'pagination' => array( 
                            'pageSize' => 20,
                        ),      
                    )
                );


No comments:

Post a Comment