🎨 webui群组代码优化 (#1683)

This commit is contained in:
HibiKier
2024-10-06 01:05:37 +08:00
committed by GitHub
parent fd90e1ab82
commit 862427a872
3 changed files with 34 additions and 17 deletions
@@ -136,8 +136,8 @@ async def _(bot_id: str | None = None) -> Result:
async def _(bot_id: str | None = None) -> Result:
now = datetime.now()
query = Statistics
# if bot_id:
# query = query.filter(bot_id=bot_id)
if bot_id:
query = query.filter(bot_id=bot_id)
all_count = await query.annotate().count()
day_count = await query.filter(
create_time__gte=now - timedelta(hours=now.hour, minutes=now.minute)