簡體   English   中英

獲取等於1或0的記錄laravel eloqouent

[英]fetch record that is equal to 1 or 0 laravel eloqouent

我正在用這個

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

以獲取數據庫中“部門”為1的所有記錄(有效)

現在,我還想獲取所有沒有“部門”為1或0的記錄,有什么想法嗎?

如何使用whereInwhereNotIn子句?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM