diff --git a/video-gen-api/app/api/v1/admin.py b/video-gen-api/app/api/v1/admin.py index 7dbb9847..bbf732b6 100644 --- a/video-gen-api/app/api/v1/admin.py +++ b/video-gen-api/app/api/v1/admin.py @@ -253,7 +253,7 @@ async def list_credit_records( """List all credit transaction records with filters.""" query = select(CreditRecord, User.username).join( User, CreditRecord.user_id == User.id, isouter=True - ).order_by(CreditRecord.created_at.desc()) + ).order_by(CreditRecord.created_at.desc(), CreditRecord.id.desc()) count_query = select(func.count(CreditRecord.id))