您的位置:首页 > 编程语言 > PHP开发

Laravel Eloquent 的条件不等于

2016-10-09 23:33 1536 查看
方法一: 使用Eloquent的where

where('id', '!=' , 2)

方法二: 使用Eloquent的whereNotIn

->whereNotIn( 'id', [2])

参考文献:

Eloquent - where not equal to

MySQL query: where field is not equal to some of the given values
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: