fix chaofen song weixin

This commit is contained in:
lwl0608 2024-04-23 17:12:41 +08:00
parent 8e52f92b0b
commit f901feadf7
1 changed files with 10 additions and 5 deletions

View File

@ -610,10 +610,20 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
case dbstruct.ProductIdContactWechat: case dbstruct.ProductIdContactWechat:
// 获取uid微信金币价格 // 获取uid微信金币价格
coinPrice = uVasInfo.WechatCoinPrice coinPrice = uVasInfo.WechatCoinPrice
if coinPrice <= 0 {
err = errs.ErrVasInvalidCoinPrice
logger.Warn("invalid coin price, mid: %v, uid: %v, contactProductId: %v, coinPrice: %v", mid, uid, contactProductId, coinPrice)
return
}
case dbstruct.ProductIdH5ContactWechat: case dbstruct.ProductIdH5ContactWechat:
contactProductId = dbstruct.ProductIdContactWechat contactProductId = dbstruct.ProductIdContactWechat
coinPrice = uVasInfo.GetH5WechatCoinPrice() coinPrice = uVasInfo.GetH5WechatCoinPrice()
req.Oid3 = dbstruct.ProductIdH5ContactWechat req.Oid3 = dbstruct.ProductIdH5ContactWechat
if coinPrice <= 0 {
err = errs.ErrVasInvalidCoinPrice
logger.Warn("invalid coin price, mid: %v, uid: %v, contactProductId: %v, coinPrice: %v", mid, uid, contactProductId, coinPrice)
return
}
case dbstruct.ProductIdSuperfanGiftContactWechat: case dbstruct.ProductIdSuperfanGiftContactWechat:
contactProductId = dbstruct.ProductIdContactWechat contactProductId = dbstruct.ProductIdContactWechat
coinPrice = 0 coinPrice = 0
@ -622,11 +632,6 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
err = errs.ErrVasInvalidContactProduct err = errs.ErrVasInvalidContactProduct
return return
} }
if contactProductId != dbstruct.ProductIdSuperfanGiftContactWechat && coinPrice <= 0 {
err = errs.ErrVasInvalidCoinPrice
logger.Warn("invalid coin price, mid: %v, uid: %v, contactProductId: %v, coinPrice: %v", mid, uid, contactProductId, coinPrice)
return
}
// 开启事务 // 开启事务
tx, err := v.store.VasBegin(ctx) tx, err := v.store.VasBegin(ctx)