It is non-trivial to track reserved alias names in criteria::select, so this might cause a headache while debugging if two or more columns will be returned with the same name accidentally.
But, this could happen with select, too. I like the idea.
Sure. This was just an example. Using AS in SELECT helps in many situations that can’t be solved by adding a function to the model. E.g. when sorting by the AS column.
Just for the record: As it’s nicer to have the AS columns defined in the AR i now “misuse” the defaultScope(). Did only a quick test but it looks promising. That way you should be able to add complex expressions too:
public $blabla;
public function defaultScope() {
return array(
'select'=>'*,IF( <some_condition_here>, column1, column2) AS blabla',
);
}