Assumption: Only the first ten votes for a team (each row in the votes table is a vote for team_id) from a given IP address should count for a given date.
So here's the raw votes per team per day.
select team_id, vote_date, ip_address, count(*) as raw_vote_count
from votes
group by team_id, vote_date, ip_address
Now, using that, correct the number of votes down to no more than ten with a CASE expression:
select team_id, vote_date, ip_address,
case when raw_vote_count > 10
then 10
else raw_vote_count
end as adjusted_vote_count
from (select team_id, vote_date, ip_address, count(*) as raw_vote_count
from votes
group by team_id, vote_date, ip_address
) sub1
If you then want a total votes by day, it's:
select team_id, sum(adjusted_vote_count)
from (
select team_id, vote_date, ip_address,
case when raw_vote_count > 10
then 10
else raw_vote_count
end as adjusted_vote_count
from (select team_id, vote_date, ip_address, count(*) as raw_vote_count
from votes
group by team_id, vote_date, ip_address
) sub1
)
where date = :mydate
group by team_id
order by team_id