Merge branch 'dev-lwl/fix' into test

This commit is contained in:
lwl0608 2024-05-06 14:20:52 +08:00
commit 6d7802a2a1
1 changed files with 14 additions and 10 deletions

View File

@ -23,6 +23,14 @@ var OrderStatusDescMap = map[int32]string{
VasOrderStatusRefund: "已退款", VasOrderStatusRefund: "已退款",
} }
var ZoneVIPMidMap = map[int64]bool{
161: true,
}
func IsVIP(mid int64) bool {
return ZoneVIPMidMap[mid]
}
// 现金订单 // 现金订单
type Order struct { type Order struct {
ID *string `json:"id" db:"id"` // 订单id ID *string `json:"id" db:"id"` // 订单id
@ -979,7 +987,7 @@ type ZoneUnlock struct {
} }
func (p *ZoneUnlock) IsUnlockAdmission() bool { func (p *ZoneUnlock) IsUnlockAdmission() bool {
if p.IsVIP() { if IsVIP(p.GetMid()) {
return true return true
} }
if ValidZoneUnlockType[p.GetAdmissionUnlockType()] && if ValidZoneUnlockType[p.GetAdmissionUnlockType()] &&
@ -990,7 +998,7 @@ func (p *ZoneUnlock) IsUnlockAdmission() bool {
} }
func (p *ZoneUnlock) IsUnlockIronfanship() bool { func (p *ZoneUnlock) IsUnlockIronfanship() bool {
if p.IsVIP() { if IsVIP(p.GetMid()) {
return true return true
} }
if ValidZoneUnlockType[p.GetIronfanshipUnlockType()] && p.IsUnlockAdmission() && if ValidZoneUnlockType[p.GetIronfanshipUnlockType()] && p.IsUnlockAdmission() &&
@ -1001,7 +1009,7 @@ func (p *ZoneUnlock) IsUnlockIronfanship() bool {
} }
func (p *ZoneUnlock) IsUnlockSuperfanship() bool { func (p *ZoneUnlock) IsUnlockSuperfanship() bool {
if p.IsVIP() { if IsVIP(p.GetMid()) {
return true return true
} }
if ValidZoneUnlockType[p.GetSuperfanshipUnlockType()] && p.IsUnlockAdmission() && if ValidZoneUnlockType[p.GetSuperfanshipUnlockType()] && p.IsUnlockAdmission() &&
@ -1011,13 +1019,6 @@ func (p *ZoneUnlock) IsUnlockSuperfanship() bool {
return false return false
} }
func (p *ZoneUnlock) IsVIP() bool {
if p.GetOid5() == "vip" {
return true
}
return false
}
func (p *ZoneUnlock) GetId() int64 { func (p *ZoneUnlock) GetId() int64 {
if p != nil && p.AdmissionCt != nil { if p != nil && p.AdmissionCt != nil {
return *p.AdmissionCt return *p.AdmissionCt
@ -1265,6 +1266,9 @@ type ZoneMomentUnlock struct {
} }
func (p *ZoneMomentUnlock) IsUnlock() bool { func (p *ZoneMomentUnlock) IsUnlock() bool {
if IsVIP(p.GetMid()) {
return true
}
if p.GetStatus() == ZoneMomentUnlockStatusUnlock { if p.GetStatus() == ZoneMomentUnlockStatusUnlock {
return true return true
} }