-- ============================================
-- 检查管理端所有关键表的数据情况
-- 执行此脚本可查看各模块数据统计
-- ============================================

-- 1. 用户数据统计
SELECT '========== 用户数据 ==========' AS '模块';
SELECT 'eb_user (用户表)' AS '表名', COUNT(*) AS '数量' FROM eb_user;
SELECT 'eb_user_address (用户地址)' AS '表名', COUNT(*) AS '数量' FROM eb_user_address;
SELECT 'eb_user_bill (用户账单)' AS '表名', COUNT(*) AS '数量' FROM eb_user_bill;
SELECT 'eb_user_sign (签到记录)' AS '表名', COUNT(*) AS '数量' FROM eb_user_sign;

-- 2. 社交数据统计
SELECT '========== 社交数据 ==========' AS '模块';
SELECT 'eb_dynamic (动态)' AS '表名', COUNT(*) AS '数量' FROM eb_dynamic;
SELECT 'eb_dynamic_comment (动态评论)' AS '表名', COUNT(*) AS '数量' FROM eb_dynamic_comment;
SELECT 'eb_follow (关注记录)' AS '表名', COUNT(*) AS '数量' FROM eb_follow;

-- 3. 家族数据统计
SELECT '========== 家族数据 ==========' AS '模块';
SELECT 'eb_family (家族)' AS '表名', COUNT(*) AS '数量' FROM eb_family;
SELECT 'eb_family_member (家族成员)' AS '表名', COUNT(*) AS '数量' FROM eb_family_member;

-- 4. 粉丝团数据统计
SELECT '========== 粉丝团数据 ==========' AS '模块';
SELECT 'eb_fan_group (粉丝团)' AS '表名', COUNT(*) AS '数量' FROM eb_fan_group;
SELECT 'eb_fan_group_member (粉丝团成员)' AS '表名', COUNT(*) AS '数量' FROM eb_fan_group_member;

-- 5. 通话会话数据统计
SELECT '========== 通话会话数据 ==========' AS '模块';
SELECT 'eb_call (通话记录)' AS '表名', COUNT(*) AS '数量' FROM eb_call;
SELECT 'eb_session (会话记录)' AS '表名', COUNT(*) AS '数量' FROM eb_session;

-- 6. 运营数据统计
SELECT '========== 运营数据 ==========' AS '模块';
SELECT 'eb_banner (轮播图)' AS '表名', COUNT(*) AS '数量' FROM eb_banner;
SELECT 'eb_system_message (系统消息)' AS '表名', COUNT(*) AS '数量' FROM eb_system_message;
SELECT 'eb_novice_task (新手任务)' AS '表名', COUNT(*) AS '数量' FROM eb_novice_task;
SELECT 'eb_lottery (抽奖活动)' AS '表名', COUNT(*) AS '数量' FROM eb_lottery;
SELECT 'eb_lottery_prize (抽奖奖品)' AS '表名', COUNT(*) AS '数量' FROM eb_lottery_prize;
SELECT 'eb_lottery_record (抽奖记录)' AS '表名', COUNT(*) AS '数量' FROM eb_lottery_record;
SELECT 'eb_activity (平台活动)' AS '表名', COUNT(*) AS '数量' FROM eb_activity;

-- 7. 礼物数据统计
SELECT '========== 礼物数据 ==========' AS '模块';
SELECT 'eb_gift (礼物配置)' AS '表名', COUNT(*) AS '数量' FROM eb_gift;
SELECT 'eb_gift_record (礼物记录)' AS '表名', COUNT(*) AS '数量' FROM eb_gift_record;

-- 8. 财务数据统计
SELECT '========== 财务数据 ==========' AS '模块';
SELECT 'eb_withdraw (提现记录)' AS '表名', COUNT(*) AS '数量' FROM eb_withdraw;
SELECT 'eb_recharge_order (充值订单)' AS '表名', COUNT(*) AS '数量' FROM eb_recharge_order;
SELECT 'eb_exchange_record (兑换记录)' AS '表名', COUNT(*) AS '数量' FROM eb_exchange_record;

-- 9. 审核数据统计
SELECT '========== 审核数据 ==========' AS '模块';
SELECT 'eb_certification (认证申请)' AS '表名', COUNT(*) AS '数量' FROM eb_certification;
SELECT 'eb_appeal (申诉记录)' AS '表名', COUNT(*) AS '数量' FROM eb_appeal;
SELECT 'eb_report (举报记录)' AS '表名', COUNT(*) AS '数量' FROM eb_report;
SELECT 'eb_feedback (用户反馈)' AS '表名', COUNT(*) AS '数量' FROM eb_feedback;

-- 10. 安全数据统计
SELECT '========== 安全数据 ==========' AS '模块';
SELECT 'eb_sensitive_word (敏感词)' AS '表名', COUNT(*) AS '数量' FROM eb_sensitive_word;
SELECT 'eb_blacklist (黑名单)' AS '表名', COUNT(*) AS '数量' FROM eb_blacklist;

-- 11. 缘池数据统计
SELECT '========== 缘池数据 ==========' AS '模块';
SELECT 'eb_community_category (板块)' AS '表名', COUNT(*) AS '数量' FROM eb_community_category;
SELECT 'eb_community_message (消息)' AS '表名', COUNT(*) AS '数量' FROM eb_community_message WHERE is_delete = 0;
SELECT 'eb_community_match_config (匹配配置)' AS '表名', COUNT(*) AS '数量' FROM eb_community_match_config;

-- 12. 许愿树数据统计
SELECT '========== 许愿树数据 ==========' AS '模块';
SELECT 'eb_wishtree_festival (节日)' AS '表名', COUNT(*) AS '数量' FROM eb_wishtree_festival;
SELECT 'eb_wishtree_wish (心愿)' AS '表名', COUNT(*) AS '数量' FROM eb_wishtree_wish WHERE is_delete = 0;
SELECT 'eb_wishtree_like (点赞)' AS '表名', COUNT(*) AS '数量' FROM eb_wishtree_like;
SELECT 'eb_wishtree_comment (评论)' AS '表名', COUNT(*) AS '数量' FROM eb_wishtree_comment WHERE is_delete = 0;
SELECT 'eb_wishtree_background (背景)' AS '表名', COUNT(*) AS '数量' FROM eb_wishtree_background;

-- 13. 聊天数据统计
SELECT '========== 聊天数据 ==========' AS '模块';
SELECT 'eb_chat_phrase (聊天常用语)' AS '表名', COUNT(*) AS '数量' FROM eb_chat_phrase;

-- 14. 任务数据统计
SELECT '========== 任务数据 ==========' AS '模块';
SELECT 'eb_user_task (用户任务进度)' AS '表名', COUNT(*) AS '数量' FROM eb_user_task;

-- ============================================
-- 数据汇总
-- ============================================
SELECT '========== 数据汇总 ==========' AS '模块';
SELECT 
    (SELECT COUNT(*) FROM eb_user) AS '用户数',
    (SELECT COUNT(*) FROM eb_dynamic) AS '动态数',
    (SELECT COUNT(*) FROM eb_family) AS '家族数',
    (SELECT COUNT(*) FROM eb_fan_group) AS '粉丝团数',
    (SELECT COUNT(*) FROM eb_gift) AS '礼物数',
    (SELECT COUNT(*) FROM eb_withdraw) AS '提现数',
    (SELECT COUNT(*) FROM eb_certification) AS '认证数',
    (SELECT COUNT(*) FROM eb_report) AS '举报数';
