This commit is contained in:
aozhiwei 2024-08-13 15:11:34 +08:00
parent 2883eea86e
commit 77712249a2
2 changed files with 22 additions and 17 deletions

View File

@ -174,7 +174,8 @@ func (this *RechargeApi) internalBuy(c *gin.Context,
goodsMeta.GetId(),
itemNum,
q5.ToString(price),
diamond) {
diamond,
email) {
f5.RspErr(c, 500, "server internal error")
return
}

View File

@ -9,18 +9,10 @@ import (
func AddRechargeOrder(orderId string, shortOrderId string,
netId int32, accountAddress string, passportAddress string,
currencyAddress string, currencyName string, itemId int32, itemNum int32,
price string, diamond int64) bool {
price string, diamond int64, email string) bool {
ok := false
nowTime := f5.GetApp().GetRealSeconds()
f5.GetGoStyleDb().UpsertEx(
constant.BCNFT_DB,
"t_recharge_order",
[][]string{
{"short_order_id", shortOrderId},
},
[][]string{
},
[][]string{
fields := [][]string{
{"order_id", orderId},
{"short_order_id", shortOrderId},
{"net_id", q5.ToString(netId)},
@ -34,7 +26,19 @@ func AddRechargeOrder(orderId string, shortOrderId string,
{"diamond", q5.ToString(diamond)},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
}
if email != "" {
q5.AppendSlice(&fields, []string{"email", email})
}
f5.GetGoStyleDb().UpsertEx(
constant.BCNFT_DB,
"t_recharge_order",
[][]string{
{"short_order_id", shortOrderId},
},
[][]string{
},
fields,
func (err error, lastInsertId int64, rowsAffected int64) {
ok = err == nil
},