1
我想用friendly_name(模型中的虛擬字段)檢索id的列表,但我一直在虛擬字段上獲取未知列。有任何想法嗎?無法檢索包含容器中的虛擬字段cakephp
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"
)
)
);