-- ========================================
-- 添加礼物管理菜单到直播管理下
-- ========================================

-- 1. 启用打赏记录菜单
UPDATE eb_system_menu 
SET is_show = 1, name = '打赏记录'
WHERE id = 823 
  AND pid = 675;

-- 2. 添加礼物管理菜单
INSERT INTO eb_system_menu (pid, name, icon, perms, component, menu_type, sort, is_show, is_delte)
SELECT 675, '礼物管理', '', '', '/liveManage/gift/manage/index', 'C', 801, 1, 0
WHERE NOT EXISTS (
    SELECT 1 FROM eb_system_menu 
    WHERE pid = 675 AND component = '/liveManage/gift/manage/index'
);

-- 3. 验证菜单结构
SELECT 
    '=== 直播管理 - 礼物相关菜单 ===' as section,
    id,
    pid,
    name,
    component,
    is_show,
    sort,
    CASE WHEN is_show = 1 THEN '✓ 显示' ELSE '✗ 隐藏' END as status
FROM eb_system_menu 
WHERE pid = 675 AND (name LIKE '%礼物%' OR name LIKE '%打赏%')
ORDER BY sort;

-- 4. 查看完整的直播管理菜单
SELECT 
    '=== 直播管理完整菜单 ===' as section,
    id,
    pid,
    name,
    component,
    is_show,
    sort
FROM eb_system_menu 
WHERE id = 675 OR pid = 675
ORDER BY sort;
