hi all, i wanna ask something, how to get value from cdbcriteria, i want get the value add into cgridview
the code is like this in my controller :
$criteria->select='month(date) as bulan, year(date) as tahun,count(id) as id,sum(price) as price';
$criteria->addCondition('date >= :to and date <= :from');
$criteria->params=array(
':to'=>$date[0],
':from'=>$date[1],
);
$criteria->group='tahun,bulan';
sorry, i don’t understand what u say, but when i count(id) as id and i write ‘id’ again in the view is work, same too sum(price) as price. but when i want to call month and year i just can’t use as date.
this my code in controller with the data provider :
$criteria->select='month(date) as bulan, year(date) as tahun,count(id) as id,sum(price) as price';
$criteria->addCondition('date >= :to and date <= :from');
$criteria->params=array(
':to'=>$date[0],
':from'=>$date[1],
);
$criteria->group='tahun,bulan';
}
$dataProvider=new CActiveDataProvider('BatchReport',array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>30,
),
));
$this->render('admin',array(
'dataProvider'=>$dataProvider,
'pagination'=>array(
'pageSize'=>30,
),
));