vendredi 5 juin 2020

fetching field in laravel query

I have two tables user_master and user_teams with common field user_name. I want to join the table and get the team value group by teams tried as

$filter_teams = DB::table('user_teams')
->join('user_master','user_master.user_name','=','user_teams.user_name')
->whereIn('user_master.geo',$geo)
->groupBy('user_teams.team')
->pluck('user_teams.team')
->toArray();

by may values are duplicating.I'm using postgresql



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire