嗨,我正在使用 codeigniter 加入
$this->db->join
我用了
$this->db->join ( $table2 . " as c","( c.3rdPartyID=a.ShopID OR c.3rdPartyID=a.ParentID OR c.ShopID=a.ShopID OR c.ShopID=a.ParentID ) AND c.3rdPartyID !=0 ", 'left' );
我也试过
$join_query = "( c.3rdPartyID=a.ShopID OR c.3rdPartyID=a.ParentID OR c.ShopID=a.ShopID OR c.ShopID=a.ParentID ) AND c.3rdPartyID !=0 ";
$this->db->join ( $table2 . " as c",$join_query, 'left' );
它给出了一个错误。
但是没有括号它可以正常工作,就像这样
$this->db->join ( $table2 . " as c"," c.3rdPartyID=a.ShopID OR c.3rdPartyID=a.ParentID OR c.ShopID=a.ShopID OR c.ShopID=a.ParentID AND c.3rdPartyID !=0 ", 'left' );
但在我的情况下,我需要括号,我应该去正常的 mysql 查询,codeignier 无法做到这一点,请帮助...
这是错误