使用codeigniter活动记录的多个on子句
我需要使用codeigniter活动记录对左连接查询执行一个multiple-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
$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');