From d48304090113ef29fc942d7793cf190ccf6d67e7 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Wed, 1 Dec 2021 01:30:16 +0300 Subject: [PATCH] Fix new_stats.name for deleted squadrons --- model/postgres_sql_requests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/postgres_sql_requests.py b/model/postgres_sql_requests.py index 5b3c9af..7fae8ed 100644 --- a/model/postgres_sql_requests.py +++ b/model/postgres_sql_requests.py @@ -55,13 +55,13 @@ where (sum_score - sum_score_old) <> 0 limit %(limit)s;""" select_diff_by_action_id = """select - new_stats.name as "SquadronName", - new_stats.tag, + coalesce(new_stats.name, old_stats.name) as "SquadronName", + coalesce(new_stats.tag, old_stats.tag), coalesce(new_stats.score, 0) as "TotalExperience", coalesce(old_stats.score, 0) as "TotalExperienceOld", coalesce(new_stats.score, 0) - coalesce(old_stats.score, 0) as "TotalExperienceDiff", - new_stats.leaderboard_type as "LeaderBoardType", - new_stats.platform as "Platform" + old_stats.leaderboard_type as "LeaderBoardType", + old_stats.platform as "Platform" from ( select * from squads_stats_states