-- 调试礼物API返回的数据

-- 1. 检查eb_gift表中的数据
SELECT 
    id, 
    name, 
    image, 
    diamond_price, 
    intimacy, 
    status, 
    is_heartbeat,
    level,
    sort,
    is_deleted
FROM eb_gift 
WHERE is_deleted = 0
ORDER BY sort ASC, id DESC
LIMIT 10;

-- 2. 检查是否所有礼物都被标记为删除
SELECT 
    COUNT(*) as total_gifts,
    SUM(CASE WHEN is_deleted = 0 THEN 1 ELSE 0 END) as active_gifts,
    SUM(CASE WHEN is_deleted = 1 THEN 1 ELSE 0 END) as deleted_gifts
FROM eb_gift;

-- 3. 如果is_deleted字段不存在，检查表结构
SHOW COLUMNS FROM eb_gift LIKE 'is_deleted';

-- 4. 如果没有is_deleted字段，查看所有礼物
SELECT 
    id, 
    name, 
    image, 
    diamond_price, 
    status
FROM eb_gift 
ORDER BY sort ASC, id DESC
LIMIT 10;
