From 379b72974ec5d127f5ef7fd154012653c400da53 Mon Sep 17 00:00:00 2001 From: TZFC <51830440+TZFC@users.noreply.github.com> Date: Fri, 8 Dec 2023 21:16:30 +0800 Subject: [PATCH] no bug found --- Utils/Checkin.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Utils/Checkin.py b/Utils/Checkin.py index 2fca8d0..a2cfc4a 100644 --- a/Utils/Checkin.py +++ b/Utils/Checkin.py @@ -8,23 +8,19 @@ async def record_checkin(start_time: datetime, end_time: datetime, master: str, val = (master,) cursor.execute(sql, val) dedeuserid = int(cursor.fetchall()[0][0]) - print(f"dedeuserid: {dedeuserid}") sql = "SELECT slot_0, slot_1, slot_2, slot_3, slot_4, slot_5, slot_6, slot_7, slot_8, slot_9 FROM checkin WHERE uid = %s AND room_id = %s" val = (dedeuserid, room_id) cursor.execute(sql, val) slots: tuple = cursor.fetchall()[0] head = slots.index(1) - print(f"head: {head}") next_head = head + 1 if head != 9 else 0 - print(f"nexthead: {next_head}") sql = "SELECT DISTINCT uid FROM danmu WHERE room_id = %s AND time BETWEEN %s AND %s" val = (room_id, start_time, end_time) cursor.execute(sql, val) result = cursor.fetchall() unique_uid = [item[0] for item in result] - print(f"unique_uid: {unique_uid}") sql = f"UPDATE checkin SET slot_{head} = 0 WHERE room_id = %s" val = (room_id,) @@ -32,7 +28,6 @@ async def record_checkin(start_time: datetime, end_time: datetime, master: str, sql = f"INSERT INTO checkin (room_id, uid, slot_{head}) VALUES(%s, %s, 1) ON DUPLICATE KEY UPDATE slot_{head} = 1" val = [(room_id, uid) for uid in unique_uid if uid not in blacklist and uid != dedeuserid] - print(f"updated values: {val}") cursor.executemany(sql, val) sql = f"UPDATE checkin SET slot_{next_head} = 1 where room_id = %s AND uid = %s"