From 4eb43ab93edf226b13d9784e40ce5c560a5d57a9 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Mon, 15 Apr 2024 22:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A2=98=E7=BC=96=E8=AF=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BDbug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v3/database_tools_2.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/工具v3/database_tools_2.py b/工具v3/database_tools_2.py index bc5eb744..94f59c72 100644 --- a/工具v3/database_tools_2.py +++ b/工具v3/database_tools_2.py @@ -1235,9 +1235,13 @@ def generateLaTeXBodyContentfromMariaDB(cursor,id,misc): #根据id,读取的json for id_raw in ret_list: obj_id = id_raw[0] sql = "SELECT obj_content FROM lessonobj WHERE objid = %s;" - objval = (obj_id,) - cursor.execute(sql,objval) - obj_list.append(f"{obj_id}\t{cursor.fetchall()[0][0]}") + if not obj_id.upper() == "KNONE": + objval = (obj_id,) + cursor.execute(sql,objval) + obj_list.append(f"{obj_id}\t{cursor.fetchall()[0][0]}") + else: + cursor.fetchall() + obj_list.append(f"{obj_id}\t暂无目标对应") sql = "SELECT tagname FROM tagcorresp WHERE ID = %s;" cursor.execute(sql,val) tag_list = [t[0] for t in cursor.fetchall()]