This commit is contained in:
2026-01-19 21:10:35 +08:00
parent c868422a1d
commit a8ec1a5aa1
29 changed files with 247 additions and 282 deletions

View File

@@ -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 // 可以升级为钻石