mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-09 22:00:01 +08:00
🐛 修复sqlite下的日统计查询和0权限功能调用 (#1943)
This commit is contained in:
@@ -49,7 +49,8 @@ class ChatHistory(Model):
|
||||
o = "-" if order == "DESC" else ""
|
||||
query = cls.filter(group_id=gid) if gid else cls
|
||||
if date_scope:
|
||||
query = query.filter(create_time__range=date_scope)
|
||||
filter_scope = (date_scope[0].isoformat(" "), date_scope[1].isoformat(" "))
|
||||
query = query.filter(create_time__range=filter_scope)
|
||||
return list(
|
||||
await query.annotate(count=Count("user_id"))
|
||||
.order_by(f"{o}count")
|
||||
|
||||
Reference in New Issue
Block a user