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