zhibo/debug_gift_api_response.sql
2026-01-03 19:22:42 +08:00

40 lines
807 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.

-- 调试礼物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;