This commit is contained in:
aozhiwei 2024-08-05 11:55:40 +08:00
parent f650fb85ec
commit 2d721e214e
2 changed files with 8 additions and 3 deletions

View File

@ -47,6 +47,7 @@ func (this *RechargeApi) Buy(c *gin.Context) {
reqJson := struct { reqJson := struct {
NetId int32 `json:"net_id"` NetId int32 `json:"net_id"`
GoodsId int32 `json:"goods_id"` GoodsId int32 `json:"goods_id"`
Num int32 `json:"num"`
AccountAddress string `json:"account_address"` AccountAddress string `json:"account_address"`
}{} }{}
if err := c.ShouldBindJSON(&reqJson); err != nil { if err := c.ShouldBindJSON(&reqJson); err != nil {
@ -125,13 +126,15 @@ func (this *RechargeApi) Buy(c *gin.Context) {
accountId, accountId,
orderId, orderId,
q5.ToString(shortOrderId), q5.ToString(shortOrderId),
reqJson.NetId,
reqJson.AccountAddress, reqJson.AccountAddress,
passportAddress, passportAddress,
currencyMeta.GetName(), currencyMeta.GetName(),
currencyMeta.GetAddress(), currencyMeta.GetAddress(),
goodsMeta.GetId(), goodsMeta.GetId(),
1, 1,
price) { price,
1) {
f5.RspErr(c, 500, "server internal error") f5.RspErr(c, 500, "server internal error")
return return
} }

View File

@ -7,9 +7,9 @@ import (
) )
func AddRechargeOrder(accountId string, orderId string, shortOrderId string, func AddRechargeOrder(accountId string, orderId string, shortOrderId string,
accountAddress string, passportAddress string, netId int32, accountAddress string, passportAddress string,
currencyAddress string, currencyName string, itemId int32, itemNum int64, currencyAddress string, currencyName string, itemId int32, itemNum int64,
price string) bool { price string, diamond int64) bool {
ok := false ok := false
nowTime := f5.GetApp().GetRealSeconds() nowTime := f5.GetApp().GetRealSeconds()
f5.GetGoStyleDb().UpsertEx( f5.GetGoStyleDb().UpsertEx(
@ -24,6 +24,7 @@ func AddRechargeOrder(accountId string, orderId string, shortOrderId string,
{"account_id", accountId}, {"account_id", accountId},
{"order_id", orderId}, {"order_id", orderId},
{"short_order_id", shortOrderId}, {"short_order_id", shortOrderId},
{"net_id", q5.ToString(netId)},
{"account_address", accountAddress}, {"account_address", accountAddress},
{"passport_address", passportAddress}, {"passport_address", passportAddress},
{"currency_name", currencyName}, {"currency_name", currencyName},
@ -31,6 +32,7 @@ func AddRechargeOrder(accountId string, orderId string, shortOrderId string,
{"item_id", q5.ToString(itemId)}, {"item_id", q5.ToString(itemId)},
{"item_num", q5.ToString(itemNum)}, {"item_num", q5.ToString(itemNum)},
{"price", price}, {"price", price},
{"diamond", q5.ToString(diamond)},
{"createtime", q5.ToString(nowTime)}, {"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)}, {"modifytime", q5.ToString(nowTime)},
}, },