Say I have a table that has two columns times_downloaded, times_viewed.
Now I created a custom column that gave the conversion rate. i.e. times_downloaded/times_viewed.
Next, I want to query my data and find all the pages that had a conversion rate above 50%.
i.e. $criteria->comapare(‘myCustomColumn_conversionRate’, '>: 50%).
This is what I’m trying to accomplish. I do not want an extra column that stores this conversion rate because it is redundant – I can extract it from the two columns.
Ok, I faked the totalItemCount by hardcoding it to a number in the CActiveDataProvider constructor.
i.e. ‘totalItemCount’ =>‘10’,
Now I am getting the following error:
Active record "myRecord" is trying to select an invalid column "myCustomColumn". Note, the column must exist in the table or be an expression with alias.