added counts

This commit is contained in:
CHIEFSOFT\ameye
2025-11-03 14:21:26 -05:00
parent dbe46a67ff
commit 7f6a6350eb
+2
View File
@@ -81,6 +81,8 @@ class Loan(db.Model):
logger.info(f"Get all loan models from loans model cme back")
if recent_only:
query = query.order_by(cls.created_at.desc()).limit(10)
# Get total count before pagination
total_count = query.count()
else:
# Apply filters if provided
if id: