WIP: model.get_leaderboard_sum_history and all appropriate stuff

This commit is contained in:
norohind committed 2021-12-10 00:56:48 +03:00
1 parent 8879f76372
commit 5360ab2e31
6 files changed
+128 -1

No files matched your search

+11 -1
View File
@@ -84,4 +84,14 @@ full join
limit 1)) old_stats
on new_stats.squadron_id = old_stats.squadron_id
where coalesce(new_stats.score, 0) - coalesce(old_stats.score, 0) <> 0
order by coalesce(new_stats.score, 0) - coalesce(old_stats.score, 0) desc;"""
order by coalesce(new_stats.score, 0) - coalesce(old_stats.score, 0) desc;"""
select_leaderboard_sum_history = """select
sum(score)::bigint as "Score Sum",
to_char(max(timestamp), 'YYYY-MM-DD HH24:MI:SS') as "Timestamp UTC"
from squads_stats_states
where leaderboard_type = %(LB_type)s and platform = %(platform)s
group by action_id
order by "Timestamp UTC" desc
limit 1000;
"""