简体   繁体   English

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

[英]Multiple on clause using codeigniter active record

I need to do a multiple on clause on a left join query using codeigniter active record. 我需要使用codeigniter活动记录对左联接查询执行多次on子句。 I write this code: 我写这段代码:

$this->db->join('table1', 'table1.col1 = table2.id', 'left');
$this->db->where_not_in('table.col2', $list);

by doing this codeigniter add where not in clause, while I need to add a ON clause, related to the left join. 通过执行此codeigniter,添加where not in子句,而我需要添加一个与左联接有关的ON子句。 If it's possible I would like to use active records. 如果可能,我想使用活动记录。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM