Hi to all,
I am little confused with one workaround here.
I have something like this:
$dataProvider = $dataProvider=new CActiveDataProvider('Objects', array(
'criteria'=>array(
'condition'=>"SOME CONDITION HERE",
'order'=>' `count` DESC,
),
));
//and then
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'ajaxUpdate'=>false,
'summaryText'=>false
));
So I must tell to pager:
-
If there is
count
>= 3 -> to show only only records with count >= 3. -
But if
count
< 3 only, to show only two pages. -
And third condition is if
count
< 1 - to show only one page of records.
To summarize:
I want to avoid multiple queries (currently 3) and I just wondering is there a way the pager to do this instead or to edit $dataProvider object somehow…
Coz if I tell to condition - "and count
>= 3" i miss the rest of records and need to run another query… which is really slow solution.
Thanks!