[Enhance] Self account delete

- Add support for users destroy their own accounts
This commit is contained in:
Lost-MSth
2024-02-25 17:28:54 +08:00
parent b3bf55407f
commit e206247c09
8 changed files with 125 additions and 36 deletions

View File

@@ -261,12 +261,3 @@ def ban_one_user(c, user_id):
{'a': user_id})
c.execute('''delete from login where user_id=:a''', {'a': user_id})
return
def clear_user_score(c, user_id):
# 清除用户所有成绩包括best_score和recent30以及recent数据但不包括云端存档
c.execute('''update user set rating_ptt=0, song_id='', difficulty=0, score=0, shiny_perfect_count=0, perfect_count=0, near_count=0, miss_count=0, health=0, time_played=0, rating=0, world_rank_score=0 where user_id=:a''',
{'a': user_id})
c.execute('''delete from best_score where user_id=:a''', {'a': user_id})
c.execute('''delete from recent30 where user_id=:a''', {'a': user_id})
return