diff --git a/route/group_r/group_info.go b/route/group_r/group_info.go index 294264cb5203c213b24188923342e6f408117e75..ce92b26edceb12dd505204e7a02a74c64a9331be 100644 --- a/route/group_r/group_info.go +++ b/route/group_r/group_info.go @@ -610,37 +610,33 @@ func GetRoomInfo(c *gin.Context) (*mycontext.MyContext, error) { } // 进场特效类型 var entryEffectType int // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip ,顺序从小到大 - if result.Owner != nil && result.Owner.Id != nil { - if cp, _ := rpc.GetUserCp(model, *result.Owner.Id); cp != nil { - result.CpLevel = cp.CpLevel.Level - if cp.CpUserInfo != nil && cp.CpUserInfo.Avatar != nil { - result.CpUserAvatar = *cp.CpUserInfo.Avatar + var cpEntryEffect bool + if cp, _ := rpc.GetUserCp(model, userId); cp != nil { + for _, v := range cp.MyPrivilegeList { + if v.Type == 5 { + cpEntryEffect = true } } - var cpEntryEffect bool - if cp, _ := rpc.GetUserCp(model, userId); cp != nil { - for _, v := range cp.MyPrivilegeList { - if v.Type == 5 { - cpEntryEffect = true - } - } - } - if result.Owner.IsVip { - entryEffectType = 4 - } - if result.Owner.Noble.Level > 0 { - entryEffectType = 3 - } - for _, v := range result.Owner.Svip.Privileges { - if len(v.MysteryCode) > 0 { - entryEffectType = 2 - } + result.CpLevel = cp.CpLevel.Level + if cp.CpUserInfo != nil && cp.CpUserInfo.Avatar != nil { + result.CpUserAvatar = *cp.CpUserInfo.Avatar } - if cpEntryEffect { - entryEffectType = 1 + } + if result.Owner.IsVip { + entryEffectType = 4 + } + if result.Owner.Noble.Level > 0 { + entryEffectType = 3 + } + for _, v := range result.Owner.Svip.Privileges { + if len(v.MysteryCode) > 0 { + entryEffectType = 2 } - result.EntryEffectType = entryEffectType } + if cpEntryEffect { + entryEffectType = 1 + } + result.EntryEffectType = entryEffectType resp.ResponseOk(c, result) return myContext, nil