2015-10-06 60 views
0

我用这一个取记录等于1或0 laravel eloqouent

$notification = notification::where('department', '=', 1)->get(); 

获取有1“部门”在我的数据库中的所有记录(它的工作原理)

现在,我还想获取所有既不具有“部门”1或0,任何想法,帮助?

回答

2

如何使用whereInwhereNotIn子句?

$notification = notification::whereIn('department', [1, 2])->get(); 
+0

你的天才!谢谢你的工作,像魅力:) –

+0

很高兴帮助你! – manix