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"]: