add is_superfanship_give_wechat
This commit is contained in:
parent
a1a414d6da
commit
7afa5f69fe
|
@ -540,8 +540,48 @@ func (v *Vas) UnlockZoneSuperfanship(ctx *gin.Context, tx *sqlx.Tx, order *dbstr
|
|||
|
||||
// 超粉赠送微信
|
||||
zv, _ := v.store.GetZoneVasById(ctx, zid)
|
||||
if zv.IsSuperfanshipGiveWechat != 1 {
|
||||
return nil
|
||||
if len(zv.SuperfanPriceList) <= 0 {
|
||||
if zv.IsSuperfanshipGiveWechat != 1 {
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
isSuperfanshipGiveWechat := 0
|
||||
switch order.GetProductId() {
|
||||
case dbstruct.ProductIdH5ZoneSuperfanshipEternal:
|
||||
for _, v := range zv.SuperfanPriceList {
|
||||
if v.Period == dbstruct.SuperfanshipValidPeriodEternal {
|
||||
isSuperfanshipGiveWechat = v.IsSuperfanshipGiveWechat
|
||||
}
|
||||
}
|
||||
case dbstruct.ProductIdH5ZoneSuperfanshipMonth:
|
||||
for _, v := range zv.SuperfanPriceList {
|
||||
if v.Period == dbstruct.SuperfanshipValidPeriodMonth {
|
||||
isSuperfanshipGiveWechat = v.IsSuperfanshipGiveWechat
|
||||
}
|
||||
}
|
||||
case dbstruct.ProductIdH5ZoneSuperfanshipSeason:
|
||||
for _, v := range zv.SuperfanPriceList {
|
||||
if v.Period == dbstruct.SuperfanshipValidPeriodSeason {
|
||||
isSuperfanshipGiveWechat = v.IsSuperfanshipGiveWechat
|
||||
}
|
||||
}
|
||||
case dbstruct.ProductIdH5ZoneSuperfanshipHalfYear:
|
||||
for _, v := range zv.SuperfanPriceList {
|
||||
if v.Period == dbstruct.SuperfanshipValidPeriodHalfYear {
|
||||
isSuperfanshipGiveWechat = v.IsSuperfanshipGiveWechat
|
||||
}
|
||||
}
|
||||
case dbstruct.ProductIdH5ZoneSuperfanshipYear:
|
||||
for _, v := range zv.SuperfanPriceList {
|
||||
if v.Period == dbstruct.SuperfanshipValidPeriodYear {
|
||||
isSuperfanshipGiveWechat = v.IsSuperfanshipGiveWechat
|
||||
}
|
||||
}
|
||||
}
|
||||
if isSuperfanshipGiveWechat != 1 {
|
||||
logger.Warn("isSuperfanshipGiveWechat, orderId: %v", order.GetID())
|
||||
return nil
|
||||
}
|
||||
}
|
||||
_err = v.SuperfanUnlockContact(ctx, tx, mid, zv.Mid, orderId)
|
||||
if _err != nil {
|
||||
|
|
|
@ -94,9 +94,10 @@ type ZoneVas struct {
|
|||
}
|
||||
|
||||
type SuperfanPriceItem struct {
|
||||
Period int `json:"period" bson:"period"`
|
||||
Price int64 `json:"price" bson:"price"`
|
||||
Enable int `json:"enable" bson:"enable"`
|
||||
Period int `json:"period" bson:"period"`
|
||||
Price int64 `json:"price" bson:"price"`
|
||||
Enable int `json:"enable" bson:"enable"`
|
||||
IsSuperfanshipGiveWechat int `json:"is_superfanship_give_wechat" bson:"is_superfanship_give_wechat"` // 是否开启超粉空间赠送微信 0: 不赠送, 1: 赠送
|
||||
}
|
||||
|
||||
func (p ZoneVas) GetSuperfanshipDurationSecond() int64 {
|
||||
|
|
Loading…
Reference in New Issue