thinkphp框架where中or和and同时使用方法

如何使用thinkphp的把下面的条件连接起来

('a'=1 and 'b'=2) or ('c'=3 and 'd'=4) and 'e'=5
$where_1['a'] = 1;
$where_1['b'] = 2;
$where_2['c'] = 3;
$where_2['d'] = 4;
$where_main['_complex'] = array(
    $where_1,
    $where_2,
    '_logic' => 'or'
);
$where_main['e'] = 5;
$this->user->where($where_main)->select();
发布了105 篇原创文章 · 获赞 0 · 访问量 690

猜你喜欢

转载自blog.csdn.net/binxi9894/article/details/105353429