我正在尝试打印来自该查询的数据,其中bstockBooksTableResearchIds是相等的数组(1,2,3),但我收到的错误显示如下:
$bstockBooksTableResearches = $this->BstockIn->BstockResearchs->find('list', [
'conditions' => ['BstockResearchs.id' => $bstockBooksTableResearchIds],
]) ;
答案 0 :(得分:1)
您应该在条件中添加IN
,以便您的代码
$bstockBooksTableResearches = $this->BstockIn->BstockResearchs->find('list', [
'conditions' => [
'BstockResearchs.id IN' => $bstockBooksTableResearchIds
]
]) ;
答案 1 :(得分:0)
试试这个:
$bstockBooksTableResearches = $this->BstockIn->BstockResearchs->find('list', array(
'conditions' =>array (
'BstockResearchs.id' => $bstockBooksTableResearchIds),
)) ;
更改:IN子句应该在数组中。