From b3bbab5db8308c00f2781afd44b6f6a8d7122f07 Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:33:47 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=8B=85=E4=BF=9D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=EF=BC=88?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E6=97=B6=E9=97=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tyc.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tyc.py b/tyc.py index f5447ed..ec5e9a5 100644 --- a/tyc.py +++ b/tyc.py @@ -426,11 +426,14 @@ def get_risk_info(param1, param2, param3, param4): {'企业名称': param3}, [param2, '录入时间'] ) - target_date = datetime.datetime.strptime(record['录入时间'], "%Y-%m-%d %H:%M:%S") - current_date = datetime.datetime.now() - minus = current_date - target_date - if minus.days <= param4: - return True + if record: + target_date = datetime.datetime.strptime(record['录入时间'], "%Y-%m-%d %H:%M:%S") + current_date = datetime.datetime.now() + minus = current_date - target_date + if minus.days <= param4: + return True + else: + return False else: return False