我正在使用
$where->equalTo('dailyshifthr.thrs', 0);
$where->equalTo('dailyshifthr.thrsA', 0);我需要OR not AND条件中的这两个条件。帮帮我。
发布于 2019-07-02 17:40:36
应该使用or谓词,如下所示:
$where->or->equalTo('dailyshifthr.thrs', 0);
$where->or->equalTo('dailyshifthr.thrsA', 0);如果您想将这两个条件与其他条件嵌套在一起,例如
SELECT *
from your_table
where field_a = 1
and (dailyshifthr.thrs = 0 or dailyshifthr.thrsA = 0)然后必须使用nest谓词:
$where->equalTo('field_a', 1);
$nest = $where->nest;
$nest->or->equalTo('dailyshifthr.thrs', 0);
$nest->or->equalTo('dailyshifthr.thrsA', 0);https://stackoverflow.com/questions/56804537
复制相似问题