fix: 首页去掉地市分布

This commit is contained in:
2026-11-03 10:07:22 +08:00
parent e0d165ed33
commit 5c6a8013b5
4 changed files with 1 additions and 38 deletions
-4
View File
@@ -530,7 +530,6 @@ def _pool_dashboard(rows: list[NqiAccount]) -> dict:
today = utcnow().date()
week_start = today - timedelta(days=6)
daily = {(today - timedelta(days=offset)).isoformat(): 0 for offset in range(13, -1, -1)}
cities: dict[str, int] = {}
added_today = 0
added_week = 0
for row in rows:
@@ -544,8 +543,6 @@ def _pool_dashboard(rows: list[NqiAccount]) -> dict:
added_today += 1
if week_start <= day <= today:
added_week += 1
city = str(row.city_name or "").strip() or "未填写"
cities[city] = cities.get(city, 0) + 1
return {
"total": len(rows),
"valid": sum(1 for row in rows if row.credential_valid),
@@ -555,7 +552,6 @@ def _pool_dashboard(rows: list[NqiAccount]) -> dict:
"addedToday": added_today,
"addedWeek": added_week,
"dailyAdded": [{"date": date, "count": count} for date, count in daily.items()],
"cities": [{"name": name, "count": count} for name, count in sorted(cities.items(), key=lambda item: (-item[1], item[0]))],
}