CActiveDataProvider strange behavoir

Hi all,

I have strange problem with CActiveDataProvider!

I have a model that reproduce a query like:





(SELECT serviceLogs.service_id AS 

service_id, COUNT(serviceLogs.id) AS Count, SUM(call_duration) AS

SumDuration, `t`.`id` AS `t0_c0`, `serviceLogs`.`id` AS `t1_c0`,

`serviceLogs`.`call_archive_id` AS `t1_c1`, `serviceLogs`.`date` AS

`t1_c2`, `serviceLogs`.`service_id` AS `t1_c3` FROM `call_archives` `t` 

INNER JOIN `service_logs` `serviceLogs` ON

(`serviceLogs`.`call_archive_id`=`t`.`id`)  GROUP BY serviceLogs.service_id

LIMIT 50)



The query result is like below

service_id count

1 333

3 44

4 20

5 20

6 46

7 1

But Cgridview just show rows with service_id 1 , 3 , 5 , 7!!!! (like Below)

service_id count

1 333

3 44

5 20

7 1

I don’t know why it wont show service_id 4 and 6 !

Is it possible that query shows in weblogroute be different as the query that really execute?

I stuck at this for 3 days!!!Please help.

I will assume you checked that the variables you use manually are the same as the ones used by the application.

One suspect would be the ‘limit’ since you are not using ‘order by’ the pointer used by the application connection could be different than the one you use manually, so its picking up a different set of records. Try adding order by and explicitly specifying limit start ‘limit 0,50’ to rule this out.