简体   繁体   中英

Multiple on clause using codeigniter active record

I need to do a multiple on clause on a left join query using codeigniter active record. 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. 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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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