zhibo/update_signin_data.sql
2026-01-05 16:58:39 +08:00

20 lines
643 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 更新签到记录测试数据
-- 确保 eb_user_signin_record 表数据正确
-- 更新现有记录的 continuous_days 字段随机1-7天
UPDATE eb_user_signin_record
SET continuous_days = FLOOR(1 + RAND() * 7)
WHERE continuous_days IS NULL OR continuous_days = 0;
-- 确保 reward_value 有值(根据连续天数计算)
UPDATE eb_user_signin_record
SET reward_value = continuous_days * 10
WHERE reward_value IS NULL OR reward_value = 0;
-- 查看更新后的数据
SELECT r.*, u.avatar as user_avatar, u.nickname as db_nickname
FROM eb_user_signin_record r
LEFT JOIN eb_user u ON r.uid = u.uid
ORDER BY r.id DESC
LIMIT 20;