Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MySQL-Abfrage in Laravel Eloquent

Bearbeitet:

$team = Team::find($id);
$users = User::join('teams', 'teams.id', '=', 'users.team_id')
             ->whereBetween('teams.l', [$team->l, $team->r])
             ->get(['users.id', 'users.username']);