where_in or 模糊查询 怎么是实现
where_in()->or_like()SELECT*FROMAWHEREidIN('118','101')ORipLIKE'%59%'oripLIKE'%7%'用CI...
where_in()->or_like()SELECT * FROM A WHERE id IN('118','101') OR ip LIKE '%59%' or ip LIKE '%7%' 用CI 怎么实现
展开
2013-10-19
展开全部
底层代码_compile_select中有这样一句:if (count($this->ar_like) > 0) { if (count($this->ar_where) > 0) { $sql .= "\nAND "; } $sql .= implode("\n", $this->ar_like); }还是底层类有问题。能想到的就只有这样$this->db->select()->from('test')->where("id in (1,2) or ip like '%$str1%' or ip like '%$str2%'")->get()->result_array();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询