Adding admin operations to the balance

This commit is contained in:
Vladless
2025-11-16 03:30:00 +03:00
parent 1d5c80cd35
commit 8b77ccda9e
9 changed files with 257 additions and 177 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ from sqlalchemy import func, select
from sqlalchemy.ext.asyncio import AsyncSession
from database.models import Key, Payment, User
from core.constants import PAYMENT_SYSTEMS_EXCLUDED
async def get_hot_leads(session: AsyncSession):
@@ -16,7 +17,7 @@ async def get_hot_leads(session: AsyncSession):
.where(User.trial == 1)
.where(Payment.amount > 0)
.where(Payment.status == "success")
.where(Payment.payment_system.notin_(["referral", "coupon", "cashback"]))
.where(Payment.payment_system.notin_(PAYMENT_SYSTEMS_EXCLUDED))
.where(~Payment.tg_id.in_(sub_active))
)