Unknown column 'team.id' in 'where clause'