🚨 auto fix by pre-commit hooks
Ruff Lint / Ruff Lint (push) Canceled after 0s
Sequential Lint and Type Check / ruff-call (push) Canceled after 0s
Sequential Lint and Type Check / pyright-call (push) Canceled after 0s

This commit is contained in:
pre-commit-ci[bot]
2026-09-07 17:04:13 +00:00
parent 6ba511f4d6
commit 881ec1819e
8 changed files with 22 additions and 24 deletions
+10 -8
View File
@@ -121,14 +121,16 @@ async def get_chat_history(
now = datetime.now()
filter_date = now - timedelta(days=7)
date_list = await _read_db(
lambda: ChatHistory.filter(
user_id=user_id,
group_id=group_id,
create_time__gte=filter_date,
)
.annotate(date=RawSQL("DATE(create_time)"), count=Count("id"))
.group_by("date")
.values("date", "count"),
lambda: (
ChatHistory.filter(
user_id=user_id,
group_id=group_id,
create_time__gte=filter_date,
)
.annotate(date=RawSQL("DATE(create_time)"), count=Count("id"))
.group_by("date")
.values("date", "count")
),
"MyInfo.chat_history_chart",
[],
)