我尝试使用自定义字段创建另一个自定义字段,但出现错误。我创建了该示例代码以便于理解。
模型.php:
public custom1;
public custom2;
示例代码:
...
$criteria->select=array("'custom1' AS custom1, CONCAT('variable: ', custom1) AS custom2");
...
错误:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'custom1' in 'field list'.