Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用codeigniter活动记录的多个on子句_Codeigniter_Left Join_On Clause - Fatal编程技术网

使用codeigniter活动记录的多个on子句

使用codeigniter活动记录的多个on子句,codeigniter,left-join,on-clause,Codeigniter,Left Join,On Clause,我需要使用codeigniter活动记录对左连接查询执行一个multiple-on子句。 我写这段代码: $this->db->join('table1', 'table1.col1 = table2.id', 'left'); $this->db->where_not_in('table.col2', $list); 通过这样做,codeigniter添加where not in子句,而我需要添加一个ON子句,与左连接相关。 如果可能的话,我想使用活动记录 $this

我需要使用codeigniter活动记录对左连接查询执行一个multiple-on子句。 我写这段代码:

$this->db->join('table1', 'table1.col1 = table2.id', 'left');
$this->db->where_not_in('table.col2', $list);
通过这样做,codeigniter添加where not in子句,而我需要添加一个ON子句,与左连接相关。 如果可能的话,我想使用活动记录

$this->db->join('table1', 'table1.col1 = table2.id AND col2 NOT IN ('.implode(',', $list).')', 'left');