Game7 去掉上级邀请id限制
This commit is contained in:
@@ -3,7 +3,6 @@ package game7
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"nova_task/internal/consts"
|
||||
"nova_task/internal/model"
|
||||
"nova_task/internal/pkg/errs"
|
||||
|
||||
@@ -33,29 +32,41 @@ func (l *Game7TaskCheckLogic) Game7TaskCheck(req *types.Game7TaskCheckReq) (*typ
|
||||
return nil, errs.New(errs.Reason(resultErr.Error.Code), resultErr.Error.Message)
|
||||
}
|
||||
|
||||
pb, err := l.svcCtx.PromoteBindModel.FindOneByInvitedUid(l.ctx, uid)
|
||||
if err != nil {
|
||||
if !errors.Is(err, model.ErrNotFound) {
|
||||
return nil, errs.New(errs.ErrDatabaseOperate, err)
|
||||
}
|
||||
return &types.Game7ResultData{
|
||||
IsValid: false,
|
||||
}, nil
|
||||
}
|
||||
//pb, err := l.svcCtx.PromoteBindModel.FindOneByInvitedUid(l.ctx, uid)
|
||||
//if err != nil {
|
||||
// if !errors.Is(err, model.ErrNotFound) {
|
||||
// return nil, errs.New(errs.ErrDatabaseOperate, err)
|
||||
// }
|
||||
// return &types.Game7ResultData{
|
||||
// IsValid: false,
|
||||
// }, nil
|
||||
//}
|
||||
|
||||
shareId := l.svcCtx.ConfigModel.GetInviterId(l.ctx, consts.Game7IoInviterId)
|
||||
|
||||
if pb.ShareUid != shareId {
|
||||
return nil, errs.New(errs.ErrUserNotFound, "user not found")
|
||||
}
|
||||
//shareId := l.svcCtx.ConfigModel.GetInviterId(l.ctx, consts.Game7IoInviterId)
|
||||
//
|
||||
//if pb.ShareUid != shareId {
|
||||
// return nil, errs.New(errs.ErrUserNotFound, "user not found")
|
||||
//}
|
||||
|
||||
var isValid bool
|
||||
// 1.是否在官网注册并链接钱包(是/否) 2.是否有超过两个以上的英雄(是/否) 3.是否消耗召唤券召唤了新英雄(是/否) 4. 是否在游戏内绑定了官网账号(是/否) 5. 是否有一个31级以上的英雄(是/否) 6. 是否完成了主线第一章(是/否)
|
||||
switch req.Type {
|
||||
case 1:
|
||||
isValid = pb.IsBindWallet == 1
|
||||
address, err := l.svcCtx.WalletModel.FindAddressByUid(l.ctx, uid)
|
||||
if err != nil {
|
||||
if !errors.Is(err, model.ErrNotFound) {
|
||||
return nil, errs.New(errs.ErrDatabaseOperate, err)
|
||||
}
|
||||
isValid = false
|
||||
} else {
|
||||
isValid = address != ""
|
||||
}
|
||||
case 4:
|
||||
isValid = pb.IsCreateRole == 1
|
||||
var err error
|
||||
isValid, err = l.svcCtx.RoleModel.AccountExist(l.ctx, req.Email)
|
||||
if err != nil {
|
||||
return nil, errs.New(errs.ErrDatabaseOperate, err)
|
||||
}
|
||||
case 2, 3, 5, 6:
|
||||
gp, err := l.svcCtx.GameReportModel.FindOneByUid(l.ctx, uid)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user