如何在 Laravel Eloquent 中执行 where AND where?

How can I do a where AND where in Laravel Eloquent?

这是我目前拥有的:

$query->orderBy('id', 'DESC')

        ->where('totalColorless', '!=', 0) // currently removes all of these...
        ->where('totalResidual', '!=', 0) // ...and all of these

        ->get();

我怎样才能删除同时满足两个 WHERE 条件的行?

试试 "orWhere":

[...]
->where('totalColorless', '!=', 0)
->orWhere('totalResidual', '!=', 0)
[...]

我认为你必须在 get() 之前和 where()

之后放置 orderBy()