laravel 多where条件《或》查询

$friends = $this->friendsModel->query()
->where(function ($query) use ($user_id){
$query->where('sender_id',$user_id)->orWhere('receiver_id',$user_id);
})
->whereIn('status', ['pending','stopped','blocked'])
->offset($offset)
->limit($pageSize)
->orderBy('id', 'desc')
->select('id as friend_id', 'receiver_id', 'sender_id', 'status','created_at')
->get();
© 版权声明
THE END
喜欢就支持一下吧
分享