isvip logic

This commit is contained in:
lwl0608 2024-05-06 14:20:43 +08:00
parent 6cf683249f
commit 7825f3bbf4
1 changed files with 14 additions and 10 deletions

View File

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