From 5261ed7c4cf5271f5469ce9112c010701d5a5d55 Mon Sep 17 00:00:00 2001 From: sowevo Date: Fri, 22 Aug 2025 03:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E4=B8=A4=E7=A7=8D=E5=BA=93?= =?UTF-8?q?=E5=AF=B9=E8=B4=9F=E6=95=B0=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/models/transferhistory.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/db/models/transferhistory.py b/app/db/models/transferhistory.py index 8de50def..7399da6c 100644 --- a/app/db/models/transferhistory.py +++ b/app/db/models/transferhistory.py @@ -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)