SELECT e.match_id,e.team_id
来自match_events
LEFT JOIN {{1}} e
ON e.match_id = matches.id AND e.match_event_type_id = 1
答案 0 :(得分:1)
试试这个,
$result = DB::table('matches as M')
->leftjoin('match_events as E','E.match_id','=','M.id')
->where('E.match_event_type_id',1)
->select(['E.match_id','E.team_id'])
->get();