This is my criteria definition and the count query:
$criteria = new CDbCriteria; $criteria->distinct = true; $criteria->select = 'feedback_employee_id'; $criteria->with=array( 'profileEmployee2'=>array( 'select'=>false, 'condition'=>'profile_id = :pId', 'params' => array(':pId' => $model->profile_id) ) ); $total_employees = FeedbackGrid::model()->count($criteria);
The count method is ignoring the ‘select’ clause of the criteria definition, so the results are different from the expected ones.
Besides, looking at the Yii framework changelog, this bug is suposed to be fixed since this revision:
Link to changelog in googlecode
That was version 1.1.3 (july 2010) and I am using version 1.1.7 (March 2011)
Please any hint on what’s going on here? is that bug fixed then or not?
If not, what would be the best alternative to perform the count operation with ‘select’ and relations?
Thanks in advance!