【发布时间】:2015-10-02 11:06:12
【问题描述】:
这是我目前拥有的:
$query->orderBy('id', 'DESC')
->where('totalColorless', '!=', 0) // currently removes all of these...
->where('totalResidual', '!=', 0) // ...and all of these
->get();
我怎样才能使它删除同时满足两个 WHERE 条件的行?
【问题讨论】:
-
或者我误解了您的问题,或者您的查询已经按照您的要求进行。这是在做
WHERE private != 1 AND totalColorless != 0 AND totalResidual != 0 -
有些列的 totalColorless = 0 但 totalResidual = 1,反之亦然。基本上我想同时删除 totalColorless = 0 和 totalResidual = 0 的行。
-
Err 那么就这样做吧.. 为什么你的查询不能像这样
->where('totalColorless', '=', 0)->where('totalResidual', '=', 0) -
->where('totalColorless', 0)->where('totalResidual', 0)应该可以工作。
标签: php laravel eloquent fluent