This commit is contained in:
aozhiwei 2024-08-17 17:08:59 +08:00
parent 9fcc66005a
commit 288b7d1de9
2 changed files with 5 additions and 3 deletions

View File

@ -167,8 +167,8 @@ func (this *RechargeApi) internalBuy(c *gin.Context,
return return
} }
} }
price := q5.PowInt64(10, currencyMeta.GetCurrencyDecimal()) * q5.ToInt64(goodsMeta.GetPrice()) * srcPrice := q5.ToInt64(goodsMeta.GetPrice()) * q5.ToInt64(goodsNum)
q5.ToInt64(goodsNum) price := q5.PowInt64(10, currencyMeta.GetCurrencyDecimal()) * srcPrice
if price <= 0 || price < q5.ToInt64(goodsMeta.GetPrice()) { if price <= 0 || price < q5.ToInt64(goodsMeta.GetPrice()) {
f5.RspErr(c, 3, "server internal error") f5.RspErr(c, 3, "server internal error")
return return
@ -220,6 +220,7 @@ func (this *RechargeApi) internalBuy(c *gin.Context,
goodsMeta.GetId(), goodsMeta.GetId(),
itemNum, itemNum,
price, price,
srcPrice,
diamond, diamond,
presentDiamond, presentDiamond,
email) { email) {

View File

@ -9,7 +9,7 @@ import (
func AddRechargeOrder(orderId string, shortOrderId string, func AddRechargeOrder(orderId string, shortOrderId string,
netId int32, accountAddress string, passportAddress string, netId int32, accountAddress string, passportAddress string,
currencyAddress string, currencyName string, itemId int32, itemNum int32, currencyAddress string, currencyName string, itemId int32, itemNum int32,
price int64, diamond int64, presentDiamond int64, email string) bool { price int64, srcPrice int64, diamond int64, presentDiamond int64, email string) bool {
ok := false ok := false
nowTime := f5.GetApp().GetRealSeconds() nowTime := f5.GetApp().GetRealSeconds()
fields := [][]string{ fields := [][]string{
@ -25,6 +25,7 @@ func AddRechargeOrder(orderId string, shortOrderId string,
{"price", q5.ToString(price)}, {"price", q5.ToString(price)},
{"diamond", q5.ToString(diamond)}, {"diamond", q5.ToString(diamond)},
{"present_diamond", q5.ToString(presentDiamond)}, {"present_diamond", q5.ToString(presentDiamond)},
{"return_contribution", q5.ToString(srcPrice * 1)},
{"createtime", q5.ToString(nowTime)}, {"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)}, {"modifytime", q5.ToString(nowTime)},
} }