This commit is contained in:
2026-07-15 13:03:23 +08:00
27 changed files with 591 additions and 271 deletions
+7 -7
View File
@@ -1668,21 +1668,21 @@ async def get_stats(
start_date: str = Query(None),
end_date: str = Query(None),
):
today_start = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
today_start = datetime.now(CST).replace(hour=0, minute=0, second=0, microsecond=0)
try:
if start_date:
date_start = datetime.strptime(start_date, "%Y-%m-%d")
date_start = datetime.strptime(start_date, "%Y-%m-%d").replace(tzinfo=CST)
else:
date_start = today_start
if end_date:
date_end = datetime.strptime(end_date, "%Y-%m-%d")
date_end = datetime.strptime(end_date, "%Y-%m-%d").replace(tzinfo=CST)
date_end = date_end.replace(hour=23, minute=59, second=59, microsecond=999999)
else:
date_end = datetime.now()
date_end = datetime.now(CST)
except:
date_start = today_start
date_end = datetime.now()
date_end = datetime.now(CST)
total_users = (await db.execute(
select(func.count(User.id)).where(
@@ -1983,7 +1983,7 @@ async def admin_update_generation_status(
if body.get("image_url"):
record.image_url = body["image_url"]
if new_status == "completed":
record.generated_at = datetime.now()
record.generated_at = datetime.now(CST)
await db.flush()
await log_operation(
db,