fix coin order

This commit is contained in:
lwl0608 2024-04-29 16:23:03 +08:00
parent cc7a910b72
commit f575f381e6
1 changed files with 5 additions and 5 deletions

View File

@ -776,7 +776,7 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
if originalContactProductId == dbstruct.ProductIdH5ContactWechat {
totalDias = uVasInfo.GetWechatCoinPrice()
}
incomeList, err1 := v.calcAndUpdateIncome(ctx, tx, uid, mid, req.Did, orderId, contactProductId, totalDias, dbstruct.CHSTypeIncomeContact)
incomeList, err1 := v.calcAndUpdateIncome(ctx, tx, uid, mid, req.Did, coinOrderId, contactProductId, totalDias, dbstruct.CHSTypeIncomeContact)
if err1 != nil {
logger.Error("calcAndUpdateIncome fail, coinOrder: %v, err: %v", util.ToJson(coinOrder), err1)
err = err1
@ -788,17 +788,17 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
"total_dias": totalDias,
"income_list": incomeList,
}
err = v.store.UpdateCoinOrderExt(ctx, tx, orderId, util.ToJson(orderExt))
err = v.store.UpdateCoinOrderExt(ctx, tx, coinOrderId, util.ToJson(orderExt))
if err != nil {
logger.Error("UpdateCoinOrderExt fail, order_id: %v, ext: %v, err: %v", orderId, util.ToJson(orderExt), err)
logger.Error("UpdateCoinOrderExt fail, order_id: %v, ext: %v, err: %v", coinOrderId, util.ToJson(orderExt), err)
return
}
// 增加空间消费
if coinPrice > 0 {
_err := v.IncZoneConsume(ctx, tx, 0, mid, uid, coinPrice, orderId, contactProductId)
_err := v.IncZoneConsume(ctx, tx, 0, mid, uid, coinPrice*10, coinOrderId, contactProductId)
if _err != nil {
logger.Error("IncZoneConsume fail, mid: %v, streamerMid: %v, orderId: %v, err: %v", mid, uid, orderId, err)
logger.Error("IncZoneConsume fail, mid: %v, streamerMid: %v, coinOrderId: %v, err: %v", mid, uid, coinOrderId, err)
}
}
}