Yii Dataprovider Change The Attributes Of A Column For Each Result

I’m using Yii’s Dataprovider to output a bunch of users based on the column “points”;

It works fine now but I have to add a feature so if the user is online, he gets an extra 300 points.

Say Jack has 100 points, Richmond has 300 points, However Jack is online, so Jack should rank higher than Richmond.

Here is my solution now:

$user=new Rank('search');


$user->category_id = $cid; 

$dataProvider = $user->search();

$iterator = new CDataProviderIterator($dataProvider);

foreach($iterator as $data) {

//check if online ,update points


However, this CDataProviderIterator seems change my pagination directly to the last page and I can’t even switch page anymore. What should I do?

Thank you very much!


Please can you paste your output screenshot…It will help to solve the problem


chandran nepolean