0
点赞
收藏
分享

微信扫一扫

Laravel:whereIn子查询

boom莎卡拉卡 2022-11-20 阅读 87


文档

  • ​​https://learnku.com/docs/laravel/9.x/queries/12246#08034f​​

示例如下

$users = User::whereNotIn('id', function ($query) use($user){
$query->select('user_id')
->from('tb_relation')
->where('tb_relation.userId', $user->id);
});

参考
​laravel whereNotIn where子查詢​​


举报

相关推荐

0 条评论