Hi,
i have a table ‘annonce’ that contains several articles.
some of them are PREMIUM
In my CgridView,I’m tryng to display 3 Premium articles, and then the rest
I can’t get this working but it works fine if I do it in phpMyAdmin as so :
(SELECT * FROM annonce ORDER BY is_premium DESC, id DESC LIMIT 0,3)
UNION
(SELECT * FROM annonce ORDER BY id DESC LIMIT 0,30)
can anyone help me with this ?
here’s a part of my Yii Code :
$criteria=new CDbCriteria(array(
'condition'=>'t.is_deleted=0 AND t.is_valid=1',
));
$criteria->order = 't.id DESC';
$criteria->together = TRUE;
$dataProvider=new CActiveDataProvider('Annonce', array(
'pagination'=>array(
'pageSize'=>10,
),
'criteria'=>$criteria,
));
Thannks alot !