2015-10-06 59 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