f
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
@@ -241,12 +241,12 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
|
||||
|
||||
// 4.8 更新邀请码状态
|
||||
// 钻石级别的邀请码只能使用一次,使用后立即失效
|
||||
// 普通级别的邀请码可以无限使用,不更新状态
|
||||
// 白银级别的邀请码可以无限使用,不更新状态
|
||||
if targetLevel == 3 {
|
||||
// 钻石邀请码:使用后失效
|
||||
inviteCodeModel.Status = 1 // 已使用(使用后立即失效)
|
||||
}
|
||||
// 记录使用信息(用于统计,普通邀请码可以多次使用)
|
||||
// 记录使用信息(用于统计,白银邀请码可以多次使用)
|
||||
inviteCodeModel.UsedUserId = sql.NullString{String: userID, Valid: true}
|
||||
if inviteCodeModel != nil {
|
||||
inviteCodeModel.UsedAgentId = sql.NullString{String: newAgent.Id, Valid: true}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/xerr"
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
@@ -115,7 +115,7 @@ func (l *ApplyUpgradeLogic) ApplyUpgrade(req *types.ApplyUpgradeReq) (resp *type
|
||||
// canUpgrade 检查是否可以升级
|
||||
func (l *ApplyUpgradeLogic) canUpgrade(fromLevel, toLevel int64, upgradeType int64) bool {
|
||||
if upgradeType == 1 { // 自主付费
|
||||
if fromLevel == 1 { // 普通
|
||||
if fromLevel == 1 { // 白银
|
||||
return toLevel == 2 || toLevel == 3 // 可以升级为黄金或钻石
|
||||
} else if fromLevel == 2 { // 黄金
|
||||
return toLevel == 3 // 可以升级为钻石
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/tool"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/hex"
|
||||
@@ -9,12 +15,6 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/tool"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/pkg/errors"
|
||||
@@ -70,17 +70,17 @@ func (l *GeneratingLinkLogic) GeneratingLink(req *types.AgentGeneratingLinkReq)
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "获取等级加成配置失败, %v", err)
|
||||
}
|
||||
|
||||
basePrice := productConfig.BasePrice
|
||||
actualBasePrice := basePrice + float64(levelBonus)
|
||||
systemMaxPrice := productConfig.SystemMaxPrice
|
||||
upliftAmount, err := l.getLevelMaxUpliftAmount(agentModel.Level)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "获取等级上调金额失败, %v", err)
|
||||
}
|
||||
levelMaxPrice := systemMaxPrice + upliftAmount
|
||||
if req.SetPrice < actualBasePrice || req.SetPrice > levelMaxPrice {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("设定价格必须在 %.2f 到 %.2f 之间"), "设定价格必须在 %.2f 到 %.2f 之间", actualBasePrice, levelMaxPrice)
|
||||
}
|
||||
basePrice := productConfig.BasePrice
|
||||
actualBasePrice := basePrice + float64(levelBonus)
|
||||
systemMaxPrice := productConfig.SystemMaxPrice
|
||||
upliftAmount, err := l.getLevelMaxUpliftAmount(agentModel.Level)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "获取等级上调金额失败, %v", err)
|
||||
}
|
||||
levelMaxPrice := systemMaxPrice + upliftAmount
|
||||
if req.SetPrice < actualBasePrice || req.SetPrice > levelMaxPrice {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("设定价格必须在 %.2f 到 %.2f 之间"), "设定价格必须在 %.2f 到 %.2f 之间", actualBasePrice, levelMaxPrice)
|
||||
}
|
||||
|
||||
// 6. 检查是否已存在相同的链接(同一代理、同一产品、同一价格)
|
||||
builder := l.svcCtx.AgentLinkModel.SelectBuilder().Where(squirrel.And{
|
||||
@@ -173,7 +173,7 @@ func (l *GeneratingLinkLogic) GeneratingLink(req *types.AgentGeneratingLinkReq)
|
||||
func (l *GeneratingLinkLogic) getLevelBonus(level int64) (int64, error) {
|
||||
var configKey string
|
||||
switch level {
|
||||
case 1: // 普通
|
||||
case 1: // 白银
|
||||
configKey = "level_1_bonus"
|
||||
case 2: // 黄金
|
||||
configKey = "level_2_bonus"
|
||||
@@ -206,27 +206,27 @@ func (l *GeneratingLinkLogic) getLevelBonus(level int64) (int64, error) {
|
||||
}
|
||||
|
||||
func (l *GeneratingLinkLogic) getLevelMaxUpliftAmount(level int64) (float64, error) {
|
||||
var key string
|
||||
switch level {
|
||||
case 2:
|
||||
key = "gold_max_uplift_amount"
|
||||
case 3:
|
||||
key = "diamond_max_uplift_amount"
|
||||
default:
|
||||
return 0, nil
|
||||
}
|
||||
config, err := l.svcCtx.AgentConfigModel.FindOneByConfigKey(l.ctx, key)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
v, err := strconv.ParseFloat(config.ConfigValue, 64)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
if v < 0 {
|
||||
return 0, nil
|
||||
}
|
||||
return v, nil
|
||||
var key string
|
||||
switch level {
|
||||
case 2:
|
||||
key = "gold_max_uplift_amount"
|
||||
case 3:
|
||||
key = "diamond_max_uplift_amount"
|
||||
default:
|
||||
return 0, nil
|
||||
}
|
||||
config, err := l.svcCtx.AgentConfigModel.FindOneByConfigKey(l.ctx, key)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
v, err := strconv.ParseFloat(config.ConfigValue, 64)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
if v < 0 {
|
||||
return 0, nil
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// getOrCreateShortLink 获取或创建短链
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -104,7 +104,7 @@ func (l *GetAgentInfoLogic) GetAgentInfo() (resp *types.AgentInfoResp, err error
|
||||
func (l *GetAgentInfoLogic) getLevelName(level int64) string {
|
||||
switch level {
|
||||
case 1:
|
||||
return "普通"
|
||||
return "白银"
|
||||
case 2:
|
||||
return "黄金"
|
||||
case 3:
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/xerr"
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -78,9 +78,9 @@ func (l *GetAgentProductConfigLogic) GetAgentProductConfig() (resp *types.AgentP
|
||||
// 计算该产品的实际底价
|
||||
productActualBasePrice := productBasePrice + float64(levelBonus)
|
||||
|
||||
priceRangeMin := productActualBasePrice
|
||||
upliftAmount, _ := l.getLevelMaxUpliftAmount(agentModel.Level)
|
||||
priceRangeMax := productConfig.SystemMaxPrice + upliftAmount
|
||||
priceRangeMin := productActualBasePrice
|
||||
upliftAmount, _ := l.getLevelMaxUpliftAmount(agentModel.Level)
|
||||
priceRangeMax := productConfig.SystemMaxPrice + upliftAmount
|
||||
|
||||
// 使用产品配置的提价阈值和手续费比例,如果为NULL则使用0
|
||||
productPriceThreshold := 0.0
|
||||
@@ -113,7 +113,7 @@ func (l *GetAgentProductConfigLogic) GetAgentProductConfig() (resp *types.AgentP
|
||||
func (l *GetAgentProductConfigLogic) getLevelBonus(level int64) (int64, error) {
|
||||
var configKey string
|
||||
switch level {
|
||||
case 1: // 普通
|
||||
case 1: // 白银
|
||||
configKey = "level_1_bonus"
|
||||
case 2: // 黄金
|
||||
configKey = "level_2_bonus"
|
||||
@@ -146,25 +146,25 @@ func (l *GetAgentProductConfigLogic) getLevelBonus(level int64) (int64, error) {
|
||||
}
|
||||
|
||||
func (l *GetAgentProductConfigLogic) getLevelMaxUpliftAmount(level int64) (float64, error) {
|
||||
var key string
|
||||
switch level {
|
||||
case 2:
|
||||
key = "gold_max_uplift_amount"
|
||||
case 3:
|
||||
key = "diamond_max_uplift_amount"
|
||||
default:
|
||||
return 0, nil
|
||||
}
|
||||
config, err := l.svcCtx.AgentConfigModel.FindOneByConfigKey(l.ctx, key)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
v, err := strconv.ParseFloat(config.ConfigValue, 64)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
if v < 0 {
|
||||
return 0, nil
|
||||
}
|
||||
return v, nil
|
||||
var key string
|
||||
switch level {
|
||||
case 2:
|
||||
key = "gold_max_uplift_amount"
|
||||
case 3:
|
||||
key = "diamond_max_uplift_amount"
|
||||
default:
|
||||
return 0, nil
|
||||
}
|
||||
config, err := l.svcCtx.AgentConfigModel.FindOneByConfigKey(l.ctx, key)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
v, err := strconv.ParseFloat(config.ConfigValue, 64)
|
||||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
if v < 0 {
|
||||
return 0, nil
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ func (l *GetLevelPrivilegeLogic) GetLevelPrivilege() (resp *types.GetLevelPrivil
|
||||
productConfigs, err := l.svcCtx.AgentProductConfigModel.FindAll(l.ctx, builder, "")
|
||||
if err == nil {
|
||||
for _, cfg := range productConfigs {
|
||||
// 普通等级:直接使用系统价格上限
|
||||
// 白银等级:直接使用系统价格上限
|
||||
if cfg.SystemMaxPrice > maxSetPriceLevel1 {
|
||||
maxSetPriceLevel1 = cfg.SystemMaxPrice
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
"time"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/pkg/errors"
|
||||
@@ -76,7 +76,7 @@ func (l *GetSubordinateContributionDetailLogic) GetSubordinateContributionDetail
|
||||
levelName := ""
|
||||
switch subordinate.Level {
|
||||
case 1:
|
||||
levelName = "普通"
|
||||
levelName = "白银"
|
||||
case 2:
|
||||
levelName = "黄金"
|
||||
case 3:
|
||||
@@ -375,7 +375,7 @@ func (l *GetSubordinateContributionDetailLogic) getInviteList(ctx context.Contex
|
||||
levelName := ""
|
||||
switch invitedAgent.Level {
|
||||
case 1:
|
||||
levelName = "普通"
|
||||
levelName = "白银"
|
||||
case 2:
|
||||
levelName = "黄金"
|
||||
case 3:
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -85,7 +85,7 @@ func (l *GetSubordinateListLogic) GetSubordinateList(req *types.GetSubordinateLi
|
||||
levelName := ""
|
||||
switch subordinate.Level {
|
||||
case 1:
|
||||
levelName = "普通"
|
||||
levelName = "白银"
|
||||
case 2:
|
||||
levelName = "黄金"
|
||||
case 3:
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -288,7 +288,7 @@ func (l *GetTeamListLogic) buildTeamMemberItem(agentId string, member *model.Age
|
||||
levelName := ""
|
||||
switch member.Level {
|
||||
case 1:
|
||||
levelName = "普通"
|
||||
levelName = "白银"
|
||||
case 2:
|
||||
levelName = "黄金"
|
||||
case 3:
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/pkg/errors"
|
||||
@@ -47,12 +47,12 @@ func (l *GetTeamStatisticsLogic) GetTeamStatistics() (resp *types.TeamStatistics
|
||||
}
|
||||
|
||||
// 2. 递归查询所有下级(直接+间接)
|
||||
allSubordinateIds := make(map[string]bool)
|
||||
directSubordinateIds := make(map[string]bool)
|
||||
allSubordinateIds := make(map[string]bool)
|
||||
directSubordinateIds := make(map[string]bool)
|
||||
|
||||
// 递归函数:收集所有下级ID
|
||||
var collectSubordinates func(string) error
|
||||
collectSubordinates = func(parentId string) error {
|
||||
var collectSubordinates func(string) error
|
||||
collectSubordinates = func(parentId string) error {
|
||||
// 查询直接下级
|
||||
builder := l.svcCtx.AgentRelationModel.SelectBuilder().
|
||||
Where("parent_id = ? AND relation_type = ? AND del_state = ?", parentId, 1, globalkey.DelStateNo)
|
||||
@@ -63,23 +63,23 @@ func (l *GetTeamStatisticsLogic) GetTeamStatistics() (resp *types.TeamStatistics
|
||||
|
||||
for _, relation := range relations {
|
||||
// 如果是第一层,标记为直接下级
|
||||
if parentId == agent.Id {
|
||||
directSubordinateIds[relation.ChildId] = true
|
||||
}
|
||||
// 添加到所有下级集合
|
||||
allSubordinateIds[relation.ChildId] = true
|
||||
// 递归查询下级的下级
|
||||
if err := collectSubordinates(relation.ChildId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if parentId == agent.Id {
|
||||
directSubordinateIds[relation.ChildId] = true
|
||||
}
|
||||
// 添加到所有下级集合
|
||||
allSubordinateIds[relation.ChildId] = true
|
||||
// 递归查询下级的下级
|
||||
if err := collectSubordinates(relation.ChildId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 开始递归收集所有下级
|
||||
if err := collectSubordinates(agent.Id); err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询下级关系失败, %v", err)
|
||||
}
|
||||
if err := collectSubordinates(agent.Id); err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询下级关系失败, %v", err)
|
||||
}
|
||||
|
||||
// 3. 获取当前时间用于统计今日和本月新增
|
||||
now := time.Now()
|
||||
@@ -100,10 +100,10 @@ func (l *GetTeamStatisticsLogic) GetTeamStatistics() (resp *types.TeamStatistics
|
||||
}
|
||||
|
||||
// 5. 将下级ID转换为切片用于查询
|
||||
subordinateIds := make([]string, 0, len(allSubordinateIds))
|
||||
for id := range allSubordinateIds {
|
||||
subordinateIds = append(subordinateIds, id)
|
||||
}
|
||||
subordinateIds := make([]string, 0, len(allSubordinateIds))
|
||||
for id := range allSubordinateIds {
|
||||
subordinateIds = append(subordinateIds, id)
|
||||
}
|
||||
|
||||
// 6. 查询所有下级代理信息
|
||||
builder := l.svcCtx.AgentModel.SelectBuilder().
|
||||
@@ -120,7 +120,7 @@ func (l *GetTeamStatisticsLogic) GetTeamStatistics() (resp *types.TeamStatistics
|
||||
directCount := int64(len(directSubordinateIds))
|
||||
indirectCount := totalCount - directCount
|
||||
|
||||
level1Count := int64(0) // 普通
|
||||
level1Count := int64(0) // 白银
|
||||
level2Count := int64(0) // 黄金
|
||||
// 不再统计钻石,因为下级不可能是钻石
|
||||
|
||||
@@ -128,7 +128,7 @@ func (l *GetTeamStatisticsLogic) GetTeamStatistics() (resp *types.TeamStatistics
|
||||
monthNewCount := int64(0)
|
||||
|
||||
for _, member := range teamMembers {
|
||||
// 统计等级(只统计普通和黄金)
|
||||
// 统计等级(只统计白银和黄金)
|
||||
switch member.Level {
|
||||
case 1:
|
||||
level1Count++
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/crypto"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
@@ -289,8 +289,8 @@ func (l *RegisterByInviteCodeLogic) RegisterByInviteCode(req *types.RegisterByIn
|
||||
}
|
||||
l.Infof("[RegisterByInviteCode] 钻石代理创建成功, agentId: %s, 设置为团队首领", agentID)
|
||||
} else {
|
||||
// 普通/黄金代理,但没有上级(异常情况)
|
||||
l.Infof("[RegisterByInviteCode] 普通/黄金代理,无上级(异常情况), level: %d", targetLevel)
|
||||
// 白银/黄金代理,但没有上级(异常情况)
|
||||
l.Infof("[RegisterByInviteCode] 白银/黄金代理,无上级(异常情况), level: %d", targetLevel)
|
||||
newAgent.AgentCode = 0
|
||||
_, err = l.svcCtx.AgentModel.Insert(transCtx, session, newAgent)
|
||||
if err != nil {
|
||||
@@ -311,7 +311,7 @@ func (l *RegisterByInviteCodeLogic) RegisterByInviteCode(req *types.RegisterByIn
|
||||
|
||||
// 8. 更新邀请码状态
|
||||
// 钻石级别的邀请码只能使用一次,使用后立即失效
|
||||
// 普通级别的邀请码可以无限使用,不更新状态
|
||||
// 白银级别的邀请码可以无限使用,不更新状态
|
||||
if inviteCodeModel != nil {
|
||||
if targetLevel == 3 {
|
||||
// 钻石邀请码:使用后失效
|
||||
@@ -361,7 +361,7 @@ func (l *RegisterByInviteCodeLogic) RegisterByInviteCode(req *types.RegisterByIn
|
||||
levelName := ""
|
||||
switch agentLevel {
|
||||
case 1:
|
||||
levelName = "普通"
|
||||
levelName = "白银"
|
||||
case 2:
|
||||
levelName = "黄金"
|
||||
case 3:
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"bdqr-server/app/main/model"
|
||||
"bdqr-server/common/ctxdata"
|
||||
"bdqr-server/common/globalkey"
|
||||
"bdqr-server/common/xerr"
|
||||
"bdqr-server/pkg/lzkit/lzUtils"
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
@@ -82,7 +82,7 @@ func (l *UpgradeSubordinateLogic) UpgradeSubordinate(req *types.UpgradeSubordina
|
||||
upgradeRecord := &model.AgentUpgrade{
|
||||
Id: uuid.New().String(),
|
||||
AgentId: subordinateAgent.Id,
|
||||
FromLevel: 1, // 普通
|
||||
FromLevel: 1, // 白银
|
||||
ToLevel: toLevel,
|
||||
UpgradeType: 2, // 钻石升级下级
|
||||
UpgradeFee: 0, // 免费
|
||||
|
||||
Reference in New Issue
Block a user