大家好,我在'where子句'中不断得到一个未知列'Array' $receiverName
,当我调试时$receiver
我得到这个输出
array(
(int) 0 => array(
'Invoice' => array(
'receiver_id' => '3',
'id' => '1'
),
'FieldsInvoice' => array(
(int) 0 => array(
'id' => '1',
'field_id' => '9',
'invoice_id' => '1',
'entered_value' => '1000.00'
)
)
),
(int) 1 => array(
'Invoice' => array(
'receiver_id' => '4',
'id' => '2'
),
'FieldsInvoice' => array(
(int) 0 => array(
'id' => '2',
'field_id' => '9',
'invoice_id' => '2',
'entered_value' => '2000.00'
)
)
),
(int) 2 => array(
'Invoice' => array(
'receiver_id' => '7',
'id' => '3'
),
'FieldsInvoice' => array()
),
(int) 3 => array(
'Invoice' => array(
'receiver_id' => '8',
'id' => '4'
),
'FieldsInvoice' => array()
),
//returns receiver_id from the invoices table where sender_id=current user account
$receiver=$this->Invoice->find('all',array(
'fields'=>('receiver_id'),'conditions'=>array(
'sender_id'=>$accounts2)));
//returns company_name from the accounts tables where receiver_id=account.id
我想要做的是receiver_id
从数组中抓取,然后将其与account.id
然后打印进行比较,但它与我的findcompany_name
中的 where 语句引发了问题$receiverName
$receiverName=$this->Account->find('all',array(
'fields'=>('company_name'),'conditions'=>array(
'id'=>$receiver)));