From fbfa78788f862a274a4aef0c479255877d152434 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 6 Aug 2024 21:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A2=9C=E8=89=B2=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E8=BF=98=E6=98=AF=E5=BE=88=E4=B8=91=EF=BC=8C?= =?UTF-8?q?=E6=89=93=E7=AE=97=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=BF=9B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/db/dbMSG.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pywxdump/db/dbMSG.py b/pywxdump/db/dbMSG.py index bbf8027..4e5c985 100644 --- a/pywxdump/db/dbMSG.py +++ b/pywxdump/db/dbMSG.py @@ -300,11 +300,10 @@ class MsgHandler(DatabaseBase): if isinstance(end_time, str) and end_time.isdigit(): end_time = int(end_time) - # If either start_time or end_time is not an integer, set both to 0 - if not (isinstance(start_time, int) and isinstance(end_time, int)): + # if start_time or end_time is not an integer and not a float, set both to 0 + if not (isinstance(start_time, (int, float)) and isinstance(end_time, (int, float))): start_time = 0 end_time = 0 - params = () sql_wxid = "AND StrTalker = ? " if wxid else "" @@ -320,7 +319,6 @@ class MsgHandler(DatabaseBase): "WHERE StrTalker NOT LIKE '%chatroom%' " f"{sql_wxid} {sql_time} " f"GROUP BY date ORDER BY date ASC;") - result = self.execute(sql, params) if not result: @@ -346,8 +344,8 @@ class MsgHandler(DatabaseBase): if isinstance(end_time, str) and end_time.isdigit(): end_time = int(end_time) - # If either start_time or end_time is not an integer, set both to 0 - if not (isinstance(start_time, int) and isinstance(end_time, int)): + # if start_time or end_time is not an integer and not a float, set both to 0 + if not (isinstance(start_time, (int, float)) and isinstance(end_time, (int, float))): start_time = 0 end_time = 0