我正在尝试将“大于”where语句转换为CI的Active Record语法.当我使用这个代码段
$this->db->join('product_stocks',"product_stocks.size_id_fk = product_attributes.id","left"); $this->db->where('product_stocks.stock_level','> 1'); $result = $this->db->get('product_attributes')->result_array();
然后打印$this-> db-> last_query();显示WHEREproduct_stocks.stock_level =’> 1’当然不正确.这可以做吗
我认为这应该是诀窍:
$this->db->where('product_stocks.stock_level >','1'); //moved the >