mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
兼容两种库对负数的处理
This commit is contained in:
@@ -79,8 +79,8 @@ class TransferHistory(Base):
|
|||||||
cls.date.desc()
|
cls.date.desc()
|
||||||
)
|
)
|
||||||
|
|
||||||
# 当count为-1时,不限制页数查询所有
|
# 当count为负数时,不限制页数查询所有
|
||||||
if count != -1:
|
if count >= 0:
|
||||||
query = query.offset((page - 1) * count).limit(count)
|
query = query.offset((page - 1) * count).limit(count)
|
||||||
|
|
||||||
return query.all()
|
return query.all()
|
||||||
@@ -104,8 +104,8 @@ class TransferHistory(Base):
|
|||||||
cls.date.desc()
|
cls.date.desc()
|
||||||
)
|
)
|
||||||
|
|
||||||
# 当count为-1时,不限制页数查询所有
|
# 当count为负数时,不限制页数查询所有
|
||||||
if count != -1:
|
if count >= 0:
|
||||||
query = query.offset((page - 1) * count).limit(count)
|
query = query.offset((page - 1) * count).limit(count)
|
||||||
|
|
||||||
result = await db.execute(query)
|
result = await db.execute(query)
|
||||||
@@ -125,8 +125,8 @@ class TransferHistory(Base):
|
|||||||
cls.date.desc()
|
cls.date.desc()
|
||||||
)
|
)
|
||||||
|
|
||||||
# 当count为-1时,不限制页数查询所有
|
# 当count为负数时,不限制页数查询所有
|
||||||
if count != -1:
|
if count >= 0:
|
||||||
query = query.offset((page - 1) * count).limit(count)
|
query = query.offset((page - 1) * count).limit(count)
|
||||||
|
|
||||||
return query.all()
|
return query.all()
|
||||||
@@ -146,8 +146,8 @@ class TransferHistory(Base):
|
|||||||
cls.date.desc()
|
cls.date.desc()
|
||||||
)
|
)
|
||||||
|
|
||||||
# 当count为-1时,不限制页数查询所有
|
# 当count为负数时,不限制页数查询所有
|
||||||
if count != -1:
|
if count >= 0:
|
||||||
query = query.offset((page - 1) * count).limit(count)
|
query = query.offset((page - 1) * count).limit(count)
|
||||||
|
|
||||||
result = await db.execute(query)
|
result = await db.execute(query)
|
||||||
|
|||||||
Reference in New Issue
Block a user