繁体   English   中英

我该如何在Laravel Eloquent中进行“在哪里”?

[英]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)
[...]

我认为您必须将orderBy()放在get()之前和where()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM