-- 检查积分数据

-- 1. 检查user_points表结构
SHOW CREATE TABLE user_points;

-- 2. 检查user_points表数据
SELECT * FROM user_points ORDER BY id DESC LIMIT 10;

-- 3. 检查points_record表结构
SHOW CREATE TABLE points_record;

-- 4. 检查points_record表数据
SELECT * FROM points_record ORDER BY id DESC LIMIT 20;

-- 5. 检查特定用户的积分数据（假设是userId=1）
SELECT * FROM user_points WHERE user_id = 1;

-- 6. 检查特定用户的积分记录
SELECT * FROM points_record WHERE user_id = 1 ORDER BY create_time DESC;

-- 7. 统计积分记录类型分布
SELECT type, COUNT(*) as count, SUM(points) as total_points 
FROM points_record 
GROUP BY type;
