我是 cakephp 的新手,我有下一个问题:
模型:CostsCenter->Scholarship->ScholarshipsDetail
1.奖学金模型中的虚拟场:
public $virtualFields = array(
'code' => "UPPER(CONCAT(SUBSTR(CostsCenter.name, 1, 3), '-',
Scholarship.selection_year, '-', SUBSTR(Country.name, 1, 3), '-',
Postulant.number))");
2. 列出来自 ScholarshipsDetail 的 Controller 中的所有内容
$scholarships_detail = $this->ScholarshipsDetail->find('all',
array('contain' => array('Scholarship' => array('CostsCenter')),
'conditions' => array('ScholarshipsDetail.scholarship_id' => $scholarship_id)));
然后,我需要列出 ScholarshipsDetail,但出现错误:
Column not found: 1054 Unknown column 'CostsCenter.name' in 'field list'
我试图在整个奖学金的 CostsCenter 中应用“包含”,但仍然出现错误