1
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
|||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,13 +41,11 @@ func UpdateUserMoney(payOrder *model.WithdrawalRecord, userBill *model.UserBill)
|
|||||||
tx, _ := dao.Begin(db)
|
tx, _ := dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
globals.SugarLogger.Debug("===============defer", r)
|
|
||||||
panic(r)
|
panic(r)
|
||||||
}
|
}
|
||||||
dao.Commit(db, tx)
|
dao.Commit(db, tx)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
globals.SugarLogger.Debug("===============1", payOrder.OrderStatus)
|
|
||||||
switch payOrder.OrderStatus {
|
switch payOrder.OrderStatus {
|
||||||
case model.WithdrawalRecordPaySuccess:
|
case model.WithdrawalRecordPaySuccess:
|
||||||
userBill.AccountBalance = userBill.AccountBalance - payOrder.WithdrawalMoney
|
userBill.AccountBalance = userBill.AccountBalance - payOrder.WithdrawalMoney
|
||||||
@@ -60,8 +57,7 @@ func UpdateUserMoney(payOrder *model.WithdrawalRecord, userBill *model.UserBill)
|
|||||||
dao.WrapAddIDCULDEntity(table, "jxc4")
|
dao.WrapAddIDCULDEntity(table, "jxc4")
|
||||||
table.ModelIDCULD.ID = userBill.ID
|
table.ModelIDCULD.ID = userBill.ID
|
||||||
|
|
||||||
if _, err := dao.UpdateEntityTx(tx, table, "AccountBalance"); err != nil {
|
if _, err := dao.UpdateEntityTx(tx, userBill, "AccountBalance"); err != nil {
|
||||||
globals.SugarLogger.Debug("err=======", err)
|
|
||||||
dao.Rollback(db, tx)
|
dao.Rollback(db, tx)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user