请问ThinkPHP 中 where条件 or,and 同时使用~请大神出现~?

('a'=1or'b'=2)and('c'=3or('d'=4and'e'=5))请不要使用字符串_string,只用_logic和_complex。谢谢...

守着星空守着你
浏览 4702回答 1
1回答

有只小跳蛙

$where['_complex'] = [    [        'a' => 1,         'b' => 2,         '_logic' => 'or'    ],    [        'c' => 3,         '_complex' => [            'd' => 4,             'e' => 5        ],         '_logic' => 'or'    ]];如不提供_logic属性,则thinkphp使用默认属性and进行条件连接。也就是(结构补充完整):12345678910111213141516$where['_complex'] = [    [        'a' => 1,         'b' => 2,         '_logic' => 'or'    ],    [        'c' => 3,         '_complex' => [            'd' => 4,             'e' => 5,            '_logic' => 'and', //这一行可缺损        ],         '_logic' => 'or'    ]];
打开App,查看更多内容
随时随地看视频慕课网APP