mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🐛 修复今日存款数量显示
This commit is contained in:
parent
4622451326
commit
73e1a28773
@ -95,13 +95,6 @@ _matcher = on_alconna(
|
|||||||
block=True,
|
block=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
_matcher.shortcut(
|
|
||||||
r"1111",
|
|
||||||
command="mahiro-bank",
|
|
||||||
arguments=["test"],
|
|
||||||
prefix=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
_matcher.shortcut(
|
_matcher.shortcut(
|
||||||
r"存款\s*(?P<amount>\d+)?",
|
r"存款\s*(?P<amount>\d+)?",
|
||||||
command="mahiro-bank",
|
command="mahiro-bank",
|
||||||
|
|||||||
@ -241,7 +241,7 @@ class BankManager:
|
|||||||
@classmethod
|
@classmethod
|
||||||
async def get_bank_info(cls) -> bytes:
|
async def get_bank_info(cls) -> bytes:
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
now_start = datetime.now() - timedelta(
|
now_start = now - timedelta(
|
||||||
hours=now.hour, minutes=now.minute, seconds=now.second
|
hours=now.hour, minutes=now.minute, seconds=now.second
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
@ -255,7 +255,9 @@ class BankManager:
|
|||||||
MahiroBank.annotate(
|
MahiroBank.annotate(
|
||||||
amount_sum=Sum("amount"), user_count=Count("id")
|
amount_sum=Sum("amount"), user_count=Count("id")
|
||||||
).values("amount_sum", "user_count"),
|
).values("amount_sum", "user_count"),
|
||||||
MahiroBankLog.filter(create_time__gt=now_start).count(),
|
MahiroBankLog.filter(
|
||||||
|
create_time__gt=now_start, handle_type=BankHandleType.DEPOSIT
|
||||||
|
).count(),
|
||||||
MahiroBankLog.filter(handle_type=BankHandleType.INTEREST)
|
MahiroBankLog.filter(handle_type=BankHandleType.INTEREST)
|
||||||
.annotate(amount_sum=Sum("amount"))
|
.annotate(amount_sum=Sum("amount"))
|
||||||
.values("amount_sum"),
|
.values("amount_sum"),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user