|
@@ -319,6 +319,10 @@ func commReq(c *gin.Context, req md.RegisterReq) { |
|
|
}() |
|
|
}() |
|
|
var parentUser *model.User |
|
|
var parentUser *model.User |
|
|
var inviteCode string |
|
|
var inviteCode string |
|
|
|
|
|
redisConn := cache.GetPool().Get() |
|
|
|
|
|
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) |
|
|
|
|
|
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.AppInviteType, enum.AppInviteLength) |
|
|
|
|
|
inviteCode = svc.ReturnCode(utils.StrToInt(sysCfg[enum.AppInviteLength]), utils.StrToInt(sysCfg[enum.AppInviteType]), 0) |
|
|
if req.InviteCode != "" { |
|
|
if req.InviteCode != "" { |
|
|
// Todo::拥有上下级关系 |
|
|
// Todo::拥有上下级关系 |
|
|
parentUser, err = userDb.GetUserByInviteCode(req.InviteCode) |
|
|
parentUser, err = userDb.GetUserByInviteCode(req.InviteCode) |
|
@@ -335,10 +339,7 @@ func commReq(c *gin.Context, req md.RegisterReq) { |
|
|
e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") |
|
|
e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
redisConn := cache.GetPool().Get() |
|
|
|
|
|
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) |
|
|
|
|
|
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.AppInviteType, enum.AppInviteLength) |
|
|
|
|
|
inviteCode = svc.ReturnCode(utils.StrToInt(sysCfg[enum.AppInviteLength]), utils.StrToInt(sysCfg[enum.AppInviteType]), 0) |
|
|
|
|
|
|
|
|
|
|
|
initLV := 1 |
|
|
initLV := 1 |
|
|
ur := new(model.UserRelate) |
|
|
ur := new(model.UserRelate) |
|
|
ur.ParentUid = parentUser.Id |
|
|
ur.ParentUid = parentUser.Id |
|
|