获取指定的记录并过滤laravel eloqouent

时间:2015-10-10 06:48:42

标签: php database laravel laravel-5 eloquent

以下是获取'department'等于'admin'(工作)的所有记录的代码:

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

现在,我希望获取'department'等于'admin'的所有记录,同时排除'department'等于'all'的记录。任何想法,使用laravel的智能eloqouent来实现这一目标的线索?

1 个答案:

答案 0 :(得分:-3)

希望这会对你有所帮助!!使用AND中的query词组添加department = all

Laravel query builder with AND in query