diff --git a/LichessWebView/app.py b/LichessWebView/app.py index dc2e138..5046122 100644 --- a/LichessWebView/app.py +++ b/LichessWebView/app.py @@ -146,6 +146,20 @@ def get_users(): ''') total_gamers = cursor.fetchone()[0] + # Count new users today + today = date.today().isoformat() + cursor.execute("SELECT COUNT(*) FROM telegram_users WHERE DATE(created_at) = ?", (today,)) + users_today = cursor.fetchone()[0] + + # Count new gamers today (from user_gamers table) + cursor.execute(""" + SELECT COUNT(DISTINCT g.id) + FROM user_gamers ug + JOIN gamers g ON ug.gamer_id = g.id + WHERE DATE(ug.created_at) = ? + """, (today,)) + gamers_today = cursor.fetchone()[0] + # Get message counters statistics message_stats = get_message_counters_stats(DB_PATH) @@ -162,7 +176,9 @@ def get_users(): 'success': True, 'users': users, 'total_users': len(users), + 'users_today': users_today, 'total_gamers': total_gamers, + 'gamers_today': gamers_today, 'message_stats': message_stats }) diff --git a/LichessWebView/templates/index.html b/LichessWebView/templates/index.html index 0999d32..de0d378 100644 --- a/LichessWebView/templates/index.html +++ b/LichessWebView/templates/index.html @@ -285,8 +285,8 @@

๐Ÿ‘ฅ ะŸะพะปัŒะทะพะฒะฐั‚ะตะปะธ

- ะ’ัะตะณะพ ะฟะพะปัŒะทะพะฒะฐั‚ะตะปะตะน: 0
- ะšะพะป-ะฒะพ ะธะณั€ะพะบะพะฒ: 0 + ะ’ัะตะณะพ ะฟะพะปัŒะทะพะฒะฐั‚ะตะปะตะน: 0 (ัะตะณะพะดะฝั: 0)
+ ะšะพะป-ะฒะพ ะธะณั€ะพะบะพะฒ: 0 (ัะตะณะพะดะฝั: 0)
@@ -352,7 +352,9 @@ if (data.success) { users = data.users; document.getElementById('total-users').textContent = data.total_users; + document.getElementById('users-today').textContent = data.users_today || 0; document.getElementById('total-gamers').textContent = data.total_gamers; + document.getElementById('gamers-today').textContent = data.gamers_today || 0; // Update message counters if (data.message_stats) {