@@ -441,23 +441,6 @@ func commReq(c *gin.Context, req md.RegisterReq) { | |||||
e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") | e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") | ||||
return | return | ||||
} | } | ||||
initLV := 1 | |||||
ur := new(model.UserRelate) | |||||
ur.ParentUid = parentUser.Id | |||||
ur.Uid = user.Id | |||||
ur.Level = initLV | |||||
ur.InviteTime = time.Now().Format("2006-01-02 15:04:05") | |||||
userRelateDb := implement.NewUserRelateDb(db.Db) | |||||
_, err = userRelateDb.UserRelateInsert(ur) | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err) | |||||
return | |||||
} | |||||
// 插入多级关联 | |||||
go svc.RoutineMultiRelate(ur.ParentUid, ur.Uid, initLV) | |||||
} | } | ||||
var parentUid = func() int64 { | var parentUid = func() int64 { | ||||
if parentUser != nil { | if parentUser != nil { | ||||
@@ -389,6 +389,11 @@ func InviteUrl(c *gin.Context) { | |||||
// @Router /api/v1/memberCenter/parentInfo [get] | // @Router /api/v1/memberCenter/parentInfo [get] | ||||
func ParentInfo(c *gin.Context) { | func ParentInfo(c *gin.Context) { | ||||
ownUser := svc.GetUser(c) | ownUser := svc.GetUser(c) | ||||
publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) | |||||
publicPlatoonBasic, _ := publicPlatoonBasicDb.PublicPlatoonBasicSettingGetOne() | |||||
if publicPlatoonBasic != nil && int(ownUser.Id) == publicPlatoonBasic.OriginatorUid { | |||||
ownUser.ParentUid = ownUser.Id | |||||
} | |||||
if ownUser.ParentUid == 0 { | if ownUser.ParentUid == 0 { | ||||
e.OutSuc(c, md.ParentInfo{}, nil) | e.OutSuc(c, md.ParentInfo{}, nil) | ||||
return | return | ||||
@@ -16,7 +16,7 @@ require ( | |||||
github.com/go-playground/universal-translator v0.18.1 | github.com/go-playground/universal-translator v0.18.1 | ||||
github.com/go-playground/validator/v10 v10.20.0 | github.com/go-playground/validator/v10 v10.20.0 | ||||
github.com/go-redis/redis v6.15.9+incompatible | github.com/go-redis/redis v6.15.9+incompatible | ||||
github.com/gomodule/redigo v1.9.2 | |||||
github.com/gomodule/redigo v2.0.0+incompatible | |||||
github.com/jinzhu/copier v0.4.0 | github.com/jinzhu/copier v0.4.0 | ||||
github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 | github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 | ||||
github.com/qiniu/api.v7/v7 v7.8.2 | github.com/qiniu/api.v7/v7 v7.8.2 | ||||
@@ -38,6 +38,7 @@ require ( | |||||
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be | code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | ||||
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible | github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible | ||||
github.com/gin-contrib/sessions v1.0.1 | |||||
github.com/go-pay/crypto v0.0.1 | github.com/go-pay/crypto v0.0.1 | ||||
github.com/go-pay/gopay v1.5.101 | github.com/go-pay/gopay v1.5.101 | ||||
github.com/go-pay/xlog v0.0.2 | github.com/go-pay/xlog v0.0.2 | ||||