belongsToMany("App\Admin"); } //获取团队销售成员 public static function getTeamSalers($team_ids){ $data = array(); foreach($team_ids as $team_id){ $data[$team_id] = DB::table('admin')->where('team_id', $team_id)->lists('id'); } return $data; } //获取销售团队 public static function getTeams(){ $data = DB::table('teams')->where('type', 1)->lists('id'); return $data; } //获取团队名称 public static function getTeamsName(){ $data = DB::table('teams')->where('type', 1)->lists('name', 'id'); return $data; } }