diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 2924ab88..6851a288 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -126,7 +126,7 @@ func (s *Service) ApiLoginByVeriCode(ctx *gin.Context, req *loginproto.ApiLoginB // 2.如果错误码是登录信息不存在,则判断为首次登录,将创建用户信息 if ec == errcode.ErrCodeLoginNotExist { - login, account, ec = s.utilRegisterUser(ctx, &req.MobilePhoneInfoComponent, req.Inviter) + login, account, ec = s.utilRegisterUser(ctx, &req.MobilePhoneInfoComponent, req.Inviter, req.BaseRequest.DevType) if ec != errcode.ErrCodeLoginSrvOk { logger.Error("utilRegisterUser failed") ec = errcode.ErrCodeLoginRegisterUserFail diff --git a/app/mix/service/service.go b/app/mix/service/service.go index ff5ec41d..a8f45a54 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -536,7 +536,7 @@ func (s *Service) OpLoginByVeriCode(ctx *gin.Context, req *loginproto.OpLoginByV // 2.如果错误码是登录信息不存在,则判断为首次登录,将创建用户信息 if ec == errcode.ErrCodeLoginNotExist { - login, account, ec = s.utilRegisterUser(ctx, &req.MobilePhoneInfoComponent, req.Inviter) + login, account, ec = s.utilRegisterUser(ctx, &req.MobilePhoneInfoComponent, req.Inviter, req.BaseRequest.DevType) if ec != errcode.ErrCodeLoginSrvOk { logger.Error("utilRegisterUser failed") ec = errcode.ErrCodeLoginRegisterUserFail diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 8745295e..0814ab7e 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -25,7 +25,7 @@ import ( // 不向外暴露的辅助公共函数 // 注册账户 -func (s *Service) utilRegisterUser(ctx *gin.Context, req *loginproto.MobilePhoneInfoComponent, inviter *int64) (login *dbstruct.Login, account *dbstruct.Account, ec errcode.ErrCode) { +func (s *Service) utilRegisterUser(ctx *gin.Context, req *loginproto.MobilePhoneInfoComponent, inviter *int64, devType int32) (login *dbstruct.Login, account *dbstruct.Account, ec errcode.ErrCode) { var err error inviterUserId := int64(0) @@ -66,6 +66,7 @@ func (s *Service) utilRegisterUser(ctx *gin.Context, req *loginproto.MobilePhone account.RegionCode = goproto.String(req.RegionCode) account.PhoneHash = goproto.String(req.PhoneHash) account.IsAMember = goproto.Int64(0) + account.DevType = goproto.Int32(devType) if inviterUserId != 0 { account.Inviter = goproto.Int64(inviterUserId) } diff --git a/dbstruct/account.go b/dbstruct/account.go index 9c365ff0..971f6c88 100644 --- a/dbstruct/account.go +++ b/dbstruct/account.go @@ -22,6 +22,7 @@ type Account struct { DiamondNum *int64 `json:"diamond_num" bson:"diamond_num"` // 钻石数量 Inviter *int64 `json:"inviter" bson:"inviter"` // 邀请人user_id IsAMember *int64 `json:"is_a_member" bson:"is_a_member"` // 是否是会员,0-否,1-是 + DevType *int32 `bson:"dev_type"` // 注册来源 Latitude *float64 `bson:"latitude"` // 纬度 Longitude *float64 `bson:"longitude"` // 经度 Ct *int64 `json:"ct" bson:"ct"` // 创建时间