在新增题目和添加关联题时新增了添加log的功能
This commit is contained in:
parent
0cb82eb577
commit
6710db3fd1
|
|
@ -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"]:
|
||||
|
|
|
|||
Reference in New Issue