Jon*_* M. 10 php orm relationship eloquent
我有类似的东西$user->albums()->where('col', NULL),它工作正常然后我试图将它扩展为空字符串,$user->albums()->where('col', NULL)->or_where('col', '')它不起作用.
此外,我在这篇文章中看到我可以使用,where_null('col')但它没有工作,也没有记录.任何选择空或NULL col的简单方法
Jon*_*Jon 30
尝试使用orWhereNull第二个子句:
$users = DB::table('users')
->where('col', '=', '')
->orWhereNull('col')
->get();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25008 次 |
| 最近记录: |