$this->dbCriteria->select .= ' ,aes_decrypt(fieldA, "string") as fieldA_de';
}//want use this to auto get de value via db connection,
it's working good when I run className::model()->find();
but it's not working when I run className::mode()->with('relationName')->find();
Active record "ClassName" is trying to select an invalid column "aes_decrypt(fieldA". Note, the column must exist in the table or be an expression with alias.
here is all I found, can anyone know how to fix it? or anything I missed? thx.
Hm, can you show me what you have in your defaultScope() method? I just checked back with the documentation and it looks like CDbCriteria.select could be an array as well. In that case, it’ll be simple: Use CDbExpression to decrypt the field in question.