获取等于 1 或 0 的记录 laravel eloqouent
fetch record that is equal to 1 or 0 laravel eloqouent
我正在使用这个
$notification = notification::where('department', '=', 1)->get();
获取我数据库中 'department' 为 1 的所有记录(有效)
现在,我还想获取所有 'department' 都不是 1 或 0 的记录,有什么想法吗?
使用 whereIn
或 whereNotIn
子句怎么样?
$notification = notification::whereIn('department', [1, 2])->get();
我正在使用这个
$notification = notification::where('department', '=', 1)->get();
获取我数据库中 'department' 为 1 的所有记录(有效)
现在,我还想获取所有 'department' 都不是 1 或 0 的记录,有什么想法吗?
使用 whereIn
或 whereNotIn
子句怎么样?
$notification = notification::whereIn('department', [1, 2])->get();