我如何使里面包含cakephp?
这是我的代码:
$survey['Survey.soc_med'] = 'Facebook';
$conditions['Customer.membershipno !='] = '';
$this->loadModel('Customer');
$this->Customer->bindModel(array(
'hasOne' => array(
'Survey' =>array(
'foreignKey'=>'customer_id',
'conditions' =>$survey
))));
$this->Customer->Behaviors->attach('Containable');
$this->Customer->contain(array('Survey'));
$result=$this->Customer->find('all',array('conditions'=>$conditions));
我得到的结果是列出所有客户,好像绕过了bindmodel。有帮助吗?