From 6710db3fd14aeb828bfb06783a215c808855b1d3 Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Mon, 15 Apr 2024 09:31:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E6=96=B0=E5=A2=9E=E9=A2=98=E7=9B=AE?= =?UTF-8?q?=E5=92=8C=E6=B7=BB=E5=8A=A0=E5=85=B3=E8=81=94=E9=A2=98=E6=97=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E6=B7=BB=E5=8A=A0log=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v3/database_tools_2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/工具v3/database_tools_2.py b/工具v3/database_tools_2.py index 8728caa4..36c21db3 100644 --- a/工具v3/database_tools_2.py +++ b/工具v3/database_tools_2.py @@ -409,6 +409,7 @@ def AddRelatedProblemToDB(id,content,oid,editor): mydb = connect(hostname = "wwylss.synology.me", port = "13306", username="root", pwd="Wwy@0018705", db = "tikutest") mycursor = mydb.cursor() id = str(id).zfill(6) + content = content.strip() if "blank" in content: genre = "填空题" space = "" @@ -431,6 +432,9 @@ def AddRelatedProblemToDB(id,content,oid,editor): if id > oid: val = (oid, id) mycursor.execute(sql,val) + sql = "INSERT INTO logs (DATE,TIME,username,action,id,db_content) VALUE (%s,%s,%s,%s,%s,%s);" + val = (GetDate(),GetTime(),get_git_username(),"加关联题",id,content) + mycursor.execute(sql,val) mydb.commit() mydb.close() return id @@ -470,6 +474,9 @@ def AddProblemstoDict2024(startingid,raworigin,problems,editor,indexed): #将来 sql = "INSERT INTO edit_history (ID,date,editor) VALUE (%s,%s,%s);" val = (pid,GetDate(),editor.strip()) mycursor.execute(sql,val) + sql = "INSERT INTO logs (DATE,TIME,username,action,id,db_content) VALUE (%s,%s,%s,%s,%s,%s);" + val = (GetDate(),GetTime(),get_git_username(),"新增题目",pid,p.strip()) + mycursor.execute(sql,val) if "same" in meta: sql = "INSERT INTO same (ID,SAME_ID) VALUE (%s,%s);" for sid in meta["same"]: