diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index b3e237d..6356b11 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -441,23 +441,6 @@ func commReq(c *gin.Context, req md.RegisterReq) { e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") 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 { if parentUser != nil { diff --git a/app/hdl/hdl_user.go b/app/hdl/hdl_user.go index b70046f..6d9d031 100644 --- a/app/hdl/hdl_user.go +++ b/app/hdl/hdl_user.go @@ -389,6 +389,11 @@ func InviteUrl(c *gin.Context) { // @Router /api/v1/memberCenter/parentInfo [get] func ParentInfo(c *gin.Context) { 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 { e.OutSuc(c, md.ParentInfo{}, nil) return diff --git a/go.mod b/go.mod index 88c98a3..1c599f3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.20.0 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/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 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_mq.git v0.0.5 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/gopay v1.5.101 github.com/go-pay/xlog v0.0.2