fix(order): 开放普通等级租用极品专区
This commit is contained in:
@@ -629,13 +629,9 @@ func LevelForUserAfterPoints(cfg Config, points int64, override string) LevelRul
|
||||
return LevelForPoints(cfg, points)
|
||||
}
|
||||
|
||||
func CanViewPremiumLevel(code string) bool {
|
||||
switch strings.TrimSpace(code) {
|
||||
case "platinum", "diamond", "peak":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
// CanViewPremiumLevel 保留兼容语义,极品专区不再设置成长等级门槛。
|
||||
func CanViewPremiumLevel(_ string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func EffectiveDepositFreeQuotaCent(levelQuotaCent int64, manualQuotaCent int64) int64 {
|
||||
|
||||
@@ -136,11 +136,8 @@ func TestEffectiveLevelForUserHonorsManualOverride(t *testing.T) {
|
||||
if got := EffectiveLevelForUser(cfg, 5000, ""); got.Code != "peak" {
|
||||
t.Fatalf("自动等级 = %s, want peak", got.Code)
|
||||
}
|
||||
if !CanViewPremiumLevel("platinum") || !CanViewPremiumLevel("diamond") || !CanViewPremiumLevel("peak") {
|
||||
t.Fatal("铂金及以上等级应可查看极品专区")
|
||||
}
|
||||
if CanViewPremiumLevel(DefaultLevelCode) {
|
||||
t.Fatal("普通等级不应查看极品专区")
|
||||
if !CanViewPremiumLevel(DefaultLevelCode) {
|
||||
t.Fatal("普通等级也应允许查看和租用极品专区")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user