I have 2 tables in foreign key, log table BelongsTo cookie on cookie ID.
When I do like that:
$dataProvider=$model->search();
$dataProvider->criteria->select='cookie_id, max(t.date) as date, count(*) as page';
$dataProvider->criteria->group= 'cookie_id';
The dataProvder provide the corrected data, grouped by cookie ID, but the pagination shows the number of item without groupBy.
By commenting the line
$dataProvider->criteria->with= array('cookie');
the result provided is correct.
I give a look to CActive record, and I noticed that at the line 1363
I opened an issue for this bug, but still no answer…
I have a project completed with some mistakes because of this bug, I’d like to know at least if you will fix in the next time or if I should bypass hardcoding queries…