Activerecord 编码点火器,使用活动记录自定义选择数据
我想问我是否需要在我的应用程序中执行此查询Activerecord 编码点火器,使用活动记录自定义选择数据,activerecord,codeigniter,Activerecord,Codeigniter,我想问我是否需要在我的应用程序中执行此查询 select qty, type from tItem where qty=0 and (type=1 or price=100) 如何在CodeIgniter中使用活动记录 因为如果我这样做了 $this->db->where('qty','0'); $this->db->where('type','1'); $this->db->or_where('price','100'); 查询结果如下 select q
select qty, type from tItem where qty=0 and (type=1 or price=100)
如何在CodeIgniter中使用活动记录
因为如果我这样做了
$this->db->where('qty','0');
$this->db->where('type','1');
$this->db->or_where('price','100');
查询结果如下
select qty, type from tItem where qty=0 and type=1 or price=100
这不是我想说的您可以传递自定义子句,如下所示:
$this->db->where('(type = 1 OR price = 100)');