Fixed hot leads export count mismatch \ Fixed ban message formatting for popup alerts \ Fixed user deletion back button navigation

This commit is contained in:
Capybara-z
2025-09-01 15:36:02 +03:00
parent 1487fb2858
commit 9074876e3d
3 changed files with 25 additions and 8 deletions
+8 -2
View File
@@ -164,8 +164,14 @@ async def export_hot_leads_csv(session: AsyncSession) -> BufferedInputFile:
User.updated_at,
)
.where(
exists(select(Payment.tg_id).where(Payment.tg_id == User.tg_id).where(Payment.status == "success")),
not_(exists(select(Key.client_id).where(Key.tg_id == User.tg_id).where(Key.expiry_time > now_ts))),
exists(
select(Payment.tg_id)
.where(Payment.tg_id == User.tg_id)
.where(Payment.status == "success")
.where(Payment.amount > 0)
.where(Payment.payment_system.notin_(["referral", "coupon", "cashback"]))
),
not_(exists(select(Key.tg_id).where(Key.tg_id == User.tg_id).where(Key.expiry_time > now_ts))),
)
.order_by(User.updated_at.desc())
)