Skip to content

Commit

Permalink
bf/query_report_sighting
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Nov 21, 2024
1 parent f059a37 commit d8ed1fe
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/app/repositories/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ async def update_session(self, session: AsyncSession):
async def get_report_score(self, player_names: tuple[str]):
sql_select = """
select
count(sr.reporting_id) as count,
count(rs.reporting_id) as count,
subject.confirmed_ban,
subject.possible_ban,
subject.confirmed_player
from report_sighting sr
join Players voter ON sr.reporting_id = voter.id
join Players subject ON sr.reported_id = subject.id
subject.confirmed_player,
rs.manual_detect
from report_sighting rs
join Players voter ON rs.reporting_id = voter.id
join Players subject ON rs.reported_id = subject.id
WHERE voter.name in :name
GROUP BY
subject.confirmed_ban,
subject.possible_ban,
subject.confirmed_player
subject.confirmed_player,
rs.manual_detect
"""
params = {"name": player_names}
data = await self.session.execute(sqla.text(sql_select), params=params)
Expand Down

0 comments on commit d8ed1fe

Please sign in to comment.