mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-08 13:20:01 +08:00
🚨 auto fix by pre-commit hooks
This commit is contained in:
@@ -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",
|
||||
[],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user