$where['_complex'] = [
[
'a' => 1,
'b' => 2,
'_logic' => 'or'
],
[
'c' => 3,
'_complex' => [
'd' => 4,
'e' => 5
],
'_logic' => 'or'
]
];
如不提供_logic属性,则thinkphp使用默认属性and进行条件连接。
也就是(结构补充完整):
$where['_complex'] = [
[
'a' => 1,
'b' => 2,
'_logic' => 'or'
],
[
'c' => 3,
'_complex' => [
'd' => 4,
'e' => 5,
'_logic' => 'and', //这一行可缺损
],
'_logic' => 'or'
]
];