fix: improve

master
howell 3 years ago
parent 42c3153305
commit 57eb2a5a67

@ -35,6 +35,7 @@ func (r *registerUser) UserAdd(c *gin.Context, login *user.Login, info *user.Inf
} }
level := 0 level := 0
var parentID uint = 0 var parentID uint = 0
var rootID uint = 0
if info.InvitationNo != "" { if info.InvitationNo != "" {
var shareUser user.Information var shareUser user.Information
// uid := baseCode.Decode(info.InvitationNo) // uid := baseCode.Decode(info.InvitationNo)
@ -47,6 +48,10 @@ func (r *registerUser) UserAdd(c *gin.Context, login *user.Login, info *user.Inf
level = 0 level = 0
parentID = p.ID parentID = p.ID
} }
if p.Level == 10 {
level = 2
rootID = p.ID
}
} }
} }
@ -63,6 +68,7 @@ func (r *registerUser) UserAdd(c *gin.Context, login *user.Login, info *user.Inf
Identifier: time.Now().Format("060102") + baseCode.Encode(uint64(lastId)), Identifier: time.Now().Format("060102") + baseCode.Encode(uint64(lastId)),
Level: level, Level: level,
ParentID: parentID, ParentID: parentID,
RootID: rootID,
InvitationNo: baseCode.Encode(uint64(lastId)), InvitationNo: baseCode.Encode(uint64(lastId)),
} }

Loading…
Cancel
Save