我正在尝试使用友好名称(模型中的虚拟字段)检索 id 列表,但我继续在虚拟字段上获取未知列。有任何想法吗?
public $virtualFields = array(
'friendly_name' => "CONCAT(ReAgent.first_name, ' ',ReAgent.last_name)"
);
$results = $this->Re->find("all",
array("recursive" => 0,
"fields" => array("Re.id","ReAgent.friendly_name"),
"contains" => array(
"RegroupsRe" =>
array("conditions" =>
array(
"regroup_id" => $post[$field]
)
)
),
"ReAgent" => array(
"fields" => "friendly_name"
)
)
);