laravel whereDoesntHave

select * from `feeds` where not exists (select * from `black_lists` where `feeds`.`user_id` = `black_lists`.`target_id` and `user_id` = ?)
FeedModel
->whereDoesntHave('blacks', function ($query) use ($user) {
    $query->where('user_id', $user);
})
->get();

posted @ 2019-04-09 18:15  心之所依  阅读(1676)  评论(0编辑  收藏  举报