From d82397477f578e4e5ca611488c3dcbe6a2c362ed Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 6 Dec 2024 12:37:00 +0300 Subject: [PATCH] fix --- api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.py b/api.py index 0a457ab..e761fb3 100644 --- a/api.py +++ b/api.py @@ -352,8 +352,6 @@ def add_time(it: Add_time): db['id'][id]['bal'] += amount # Статистика date = datetime.today().strftime('%Y-%m-%d') - if date not in stat: - stat_run(0) # Для пользователя t2c_date = db['id'][id]['time2cdm'][1] if t2c_date != date: @@ -364,6 +362,8 @@ def add_time(it: Add_time): write(db) # Глобально stat = read('stat.json') + if date not in stat: + stat_run(0) stat[date]['time2cdm'] += amount write(stat, 'stat.json')