1.尝试修复签到不加分的错误2.移除注册时间显示
This commit is contained in:
@@ -544,12 +544,16 @@ class Database:
|
||||
today = datetime.now().strftime('%Y-%m-%d')
|
||||
|
||||
if self.check_daily_checkin(user_id, today):
|
||||
logger.warning(f"用户 {user_id} 今日已签到")
|
||||
return False
|
||||
|
||||
cursor = self.conn.cursor()
|
||||
current_time = int(time.time())
|
||||
|
||||
try:
|
||||
# 确保用户存在
|
||||
self.get_or_create_user(user_id)
|
||||
|
||||
# 记录签到
|
||||
cursor.execute(
|
||||
"INSERT INTO daily_checkins (user_id, checkin_date, points_earned, created_at) VALUES (?, ?, ?, ?)",
|
||||
@@ -557,10 +561,12 @@ class Database:
|
||||
)
|
||||
|
||||
# 添加积分
|
||||
return self.add_points(user_id, points, "daily_checkin", f"每日签到奖励")
|
||||
result = self.add_points(user_id, points, "daily_checkin", f"每日签到奖励")
|
||||
logger.info(f"用户 {user_id} 签到结果: {result}, 积分: {points}")
|
||||
return result
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"每日签到失败: {e}")
|
||||
logger.error(f"每日签到失败: {e}", exc_info=True)
|
||||
return False
|
||||
|
||||
def get_points_leaderboard(self, limit: int = 10) -> List[Dict]:
|
||||
|
||||
Reference in New Issue
Block a user