Yii cdb表达式与别名错误


yii cdbexpression expression with alias error

我有以下代码

$criteria=new CDbCriteria;
$criteria->with = array('owner'=>array('select'=>array('*','payment_info'=>'payment_account')));

这工作正常,但是当我将 concat 添加到其中时

$criteria->with = array('owner'=>array('select'=>array('*','payment_info'=>'concat(payment_account)')));

它抛给我一个错误

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. 

如何为其提供别名?

试着给它一个别名,比如:

$criteria->with = array('owner'=> array('select'=> array('*','payment_info'=>'concat(payment_account) as conc')));

我以前使用过这种方法没有问题。