【发布时间】:2018-01-31 04:32:27
【问题描述】:
我正在将以下查询转换为 eloquent:
select * from db.users
Where (linker is null) and (admin_published is null)
union
select * from db.users
Where (linker is not null) and (linker_verified = 2) and (admin_published is null)
雄辩:
\App\User::where('linker', null)->
Where('admin_published', null)->
orWhere('linker','!=',null)->where('linker_verified', '=',2)->
orWhere('admin_published','!=', 1)->get();
它没有给我linker 不为空的记录。
【问题讨论】:
标签: php mysql laravel eloquent laravel-query-builder