From b2b55962d6152eaae2e62fa5390d2b8dd8f5bbef Mon Sep 17 00:00:00 2001 From: pengtao Date: Thu, 26 Sep 2019 17:17:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=93=E5=AD=98=E7=94=9F?= =?UTF-8?q?=E6=88=90=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ad_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ad_tasks.py b/ad_tasks.py index b6e2b7d..3fbce5d 100644 --- a/ad_tasks.py +++ b/ad_tasks.py @@ -24,7 +24,7 @@ def get_area_by_locationid(ldid): sql = f"select area from location where id={ldid}" data = mydb.query(sql) if data: - return data[0][0].replace("[", "").replace("]", "").replace('"', "") + return data[0][0].strip('[]').replace('"', "") else: log.error(f"get area from location failed!,sql={sql}") return area