Laravel Eloquent 的条件不等于


方法一: 使用Eloquent的where

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

方法二: 使用Eloquent的whereNotIn

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

参考文献:

  1. Eloquent - where not equal to
  2. MySQL query: where field is not equal to some of the given values


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM