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