I have following code
$criteria=new CDbCriteria;
$criteria->with = array('owner'=>array('select'=>array('*','payment_info'=>'payment_account')));
which works fine, but when i add concat into it
$criteria->with = array('owner'=>array('select'=>array('*','payment_info'=>'concat(payment_account)')));
it throws me an error
Active record "User" is trying to select an invalid column "concat(payment_account)". Note, the column must exist in the table or be an expression with alias.
how to provide alias for it?
Try giving it an alias, like:
$criteria->with = array('owner'=> array('select'=> array('*','payment_info'=>'concat(payment_account) as conc')));I’ve used that method without a problem before.