それぞれ参照するカラム名の修正

This commit is contained in:
suti7yk5032 2024-08-23 02:17:10 +09:00
parent 668af84ca8
commit 35ba7e0dff
2 changed files with 5 additions and 5 deletions

View file

@ -422,7 +422,7 @@ class Bot(discord.Client):
pass pass
else: else:
# mouse_listの使用中ユーザーを消す # mouse_listの使用中ユーザーを消す
cursor.execute("UPDATE mouse_list SET using_member_id = NULL WHERE keyboard_number = %s", (mouse_number,)) cursor.execute("UPDATE mouse_list SET using_member_id = NULL WHERE mouse_number = %s", (mouse_number,))
dislocker.db.commit() dislocker.db.commit()
return {"result": 0, "about": "ok", "output_dict": {"pc_number": str(pc_number), "name": str(name)}} return {"result": 0, "about": "ok", "output_dict": {"pc_number": str(pc_number), "name": str(name)}}
else: else:
@ -607,7 +607,7 @@ class Bot(discord.Client):
pass pass
else: else:
# mouse_listの使用中ユーザーを消す # mouse_listの使用中ユーザーを消す
cursor.execute("UPDATE mouse_list SET using_member_id = NULL WHERE keyboard_number = %s", (mouse_number,)) cursor.execute("UPDATE mouse_list SET using_member_id = NULL WHERE mouse_number = %s", (mouse_number,))
cursor.execute("UPDATE pc_usage_history SET end_use_time = clock_timestamp(), bot_about = %s WHERE id = %s", (bot_about, pc_usage_history_record_id)) cursor.execute("UPDATE pc_usage_history SET end_use_time = clock_timestamp(), bot_about = %s WHERE id = %s", (bot_about, pc_usage_history_record_id))
dislocker.db.commit() dislocker.db.commit()
return {"result": 0, "about": "ok"} return {"result": 0, "about": "ok"}
@ -959,7 +959,7 @@ class Monitor():
print(current_datetime, start_time) print(current_datetime, start_time)
print(time_difference.seconds, timedelta(seconds=self.allowable_time).seconds) print(time_difference.seconds, timedelta(seconds=self.allowable_time).seconds)
if time_difference.seconds >= timedelta(seconds=self.allowable_time).seconds: if time_difference.seconds >= timedelta(seconds=self.allowable_time).seconds:
cursor.execute("SELECT * FROM club_member WHERE id = %s", (member_id,)) cursor.execute("SELECT * FROM club_member WHERE member_id = %s", (member_id,))
user_info = cursor.fetchall() user_info = cursor.fetchall()
stop = bot.stop(discord_user_id=user_info[0][3], bot_about="パスワードのタイムアウトでBotによる強制停止。") stop = bot.stop(discord_user_id=user_info[0][3], bot_about="パスワードのタイムアウトでBotによる強制停止。")
@ -982,7 +982,7 @@ class Monitor():
time_difference = current_datetime - start_time time_difference = current_datetime - start_time
print(time_difference.seconds, timedelta(seconds=self.allowable_time).seconds) print(time_difference.seconds, timedelta(seconds=self.allowable_time).seconds)
if time_difference.seconds >= timedelta(seconds=self.allowable_time).seconds: if time_difference.seconds >= timedelta(seconds=self.allowable_time).seconds:
cursor.execute("SELECT * FROM club_member WHERE id = %s", (member_id,)) cursor.execute("SELECT * FROM club_member WHERE member_id = %s", (member_id,))
user_info = cursor.fetchall() user_info = cursor.fetchall()
stop = bot.stop(discord_user_id=user_info[0][3], bot_about="タイムアウトでBotによる強制停止。") stop = bot.stop(discord_user_id=user_info[0][3], bot_about="タイムアウトでBotによる強制停止。")

View file

@ -129,7 +129,7 @@ class Auth():
pass pass
else: else:
# mouse_listの使用中ユーザーを消す # mouse_listの使用中ユーザーを消す
cursor.execute("UPDATE mouse_list SET using_member_id = NULL WHERE keyboard_number = %s", (mouse_number,)) cursor.execute("UPDATE mouse_list SET using_member_id = NULL WHERE mouse_number = %s", (mouse_number,))
cursor.execute("UPDATE pc_usage_history SET end_use_time = clock_timestamp() WHERE id = %s", (pc_usage_history_record_id,)) cursor.execute("UPDATE pc_usage_history SET end_use_time = clock_timestamp() WHERE id = %s", (pc_usage_history_record_id,))
self.db.commit() self.db.commit()
return {"result": 0, "about": "ok"} return {"result": 0, "about": "ok"}