get(); $r = []; foreach ($res as $val) { $r[$val->sport_id][$val->provider_group_id] = $val->competition_group_id; } return $r; } }