简体   繁体   中英

fetch record that is equal to 1 or 0 laravel eloqouent

I'm using this one

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

to fetch all records that has 'department' of 1 in my database (it works)

Now, I want to fetch also all records that neither has 'department' of 1 or 0, any ideas, help?

如何使用whereInwhereNotIn子句?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM