Eg:(‘a‘=1 and ‘b‘=2) or (‘c‘=3 and ‘d‘=4) and ‘e‘=5
解决方法
$condition1[‘a‘] = 1;$condition1[‘b‘] = 2;$condition2[‘c‘] = 3;$condition2[‘d‘] = 4;$condition[‘_complex‘] = array( ???$condition1, ???$condition2, ???‘_logic‘ => ‘or‘);$condition[‘e‘] = 5;D(‘模型‘)->where($condition)->select();
Explain:ThinkPHP 中 where条件 or,and 同时使用
原文地址:https://www.cnblogs.com/chung2017/p/9674662.html