修复签到中的错误

This commit is contained in:
2025-11-13 14:57:42 +08:00
parent 1341a13d40
commit 2853119f58

View File

@@ -304,7 +304,7 @@ class WPSCheckinAPI(WPSAPI):
cursor = get_db().conn.cursor() cursor = get_db().conn.cursor()
cursor.execute("SELECT checkin_date FROM daily_checkin WHERE user_id = ?", (user_id,)) cursor.execute("SELECT checkin_date FROM daily_checkin WHERE user_id = ?", (user_id,))
row = cursor.fetchone() row = cursor.fetchone()
return row is not None and row[0] == datetime.now().strftime("%Y-%m-%d") return row is not None and row[0] == datetime.datetime.now().strftime("%Y-%m-%d")
def _set_today_checkin_status(self, user_id: int) -> None: def _set_today_checkin_status(self, user_id: int) -> None:
cursor = get_db().conn.cursor() cursor = get_db().conn.cursor()
@@ -315,7 +315,7 @@ class WPSCheckinAPI(WPSAPI):
ON CONFLICT(user_id) DO UPDATE SET ON CONFLICT(user_id) DO UPDATE SET
checkin_date = excluded.checkin_date checkin_date = excluded.checkin_date
""", """,
(user_id, datetime.now().strftime("%Y-%m-%d")), (user_id, datetime.datetime.now().strftime("%Y-%m-%d")),
) )
get_db().conn.commit() get_db().conn.commit()