我有 5 张桌子:
表单->(字段:id,名称)HasMany(表单)
Field -> (fields : id , type , name , form_id) HasMany (Fvarchar,Ftext,Ftinyint) BelongsTo (Form)
Fvarchar -> (fields : id , value , field_id) BelongsTo (Field)
Ftext -> (fields : id , value , field_id) BelongsTo (Field)
Ftinyint -> (fields : id , value , field_id) BelongsTo (Field)
我想查找表单,Field[name]->Fvarchar,Ftext,Ftinyint[value]
但现在当我尝试查找表单时,我的结果如下:
$this->Form->find('all',array('contain' => array('Field'=>array('Fvarchar','Ftext','Ftinyint'))
'Form' => array(
'id' => '1',
'name' => 'mobile',
'Field' => array(
(int) 0 => array(
'name' => 'bluetooth',
'type' => 'Ftinyint',
'id' => '1',
'form_id' => '1',
'Ftext' => array(),
'Fvarchar' => array(),
'Ftinyint' => array(
(int) 0 => array(
'value' => true,
'id' => '2',
'field_id' => '1'
)
)
),
但我想用 Field[type] 过滤表(Ftext,Fvarchar,Ftinyint):
'Form' => array(
'id' => '1',
'name' => 'mobile',
'Field' => array(
(int) 0 => array(
'name' => 'bluetooth',
'type' => 'Ftinyint',
'id' => '1',
'form_id' => '1',
'Ftinyint' => array(
(int) 0 => array(
'value' => true,
'id' => '2',
'field_id' => '1'
)
)
),
谢谢