兼容两种库对负数的处理

This commit is contained in:
sowevo
2025-08-22 03:32:26 +08:00
parent aa8768b18a
commit 5261ed7c4c

View File

@@ -79,8 +79,8 @@ class TransferHistory(Base):
cls.date.desc()
)
# 当count为-1时,不限制页数查询所有
if count != -1:
# 当count为负数时,不限制页数查询所有
if count >= 0:
query = query.offset((page - 1) * count).limit(count)
return query.all()
@@ -104,8 +104,8 @@ class TransferHistory(Base):
cls.date.desc()
)
# 当count为-1时,不限制页数查询所有
if count != -1:
# 当count为负数时,不限制页数查询所有
if count >= 0:
query = query.offset((page - 1) * count).limit(count)
result = await db.execute(query)
@@ -125,8 +125,8 @@ class TransferHistory(Base):
cls.date.desc()
)
# 当count为-1时,不限制页数查询所有
if count != -1:
# 当count为负数时,不限制页数查询所有
if count >= 0:
query = query.offset((page - 1) * count).limit(count)
return query.all()
@@ -146,8 +146,8 @@ class TransferHistory(Base):
cls.date.desc()
)
# 当count为-1时,不限制页数查询所有
if count != -1:
# 当count为负数时,不限制页数查询所有
if count >= 0:
query = query.offset((page - 1) * count).limit(count)
result = await db.execute(query)