This commit is contained in:
邹宗楠
2022-07-12 17:15:09 +08:00
parent 7fe320cded
commit a8dc2f72df
2 changed files with 4 additions and 5 deletions

View File

@@ -79,9 +79,9 @@ func (v *BillExpend) TableIndex() [][]string {
type UserBill struct {
ModelIDCULD
BillID int64 `orm:"column(bill_id)" json:"billID"` //账单ID
UserID string `orm:"column(user_id)" json:"userID"` //用户ID
AccountBalance int `json:"accountBalance"` //账户余额
BillID int64 `orm:"column(bill_id)" json:"billID"` //账单ID
UserID string `orm:"column(user_id)" json:"userID"` //用户ID
AccountBalance int `orm:"column(account_balance)" json:"accountBalance"` //账户余额
}
func (v *UserBill) TableUnique() [][]string {

View File

@@ -50,8 +50,7 @@ func UpdateUserMoney(payOrder *model.WithdrawalRecord, userBill *model.UserBill)
switch payOrder.OrderStatus {
case model.WithdrawalRecordPaySuccess:
userBill.AccountBalance = userBill.AccountBalance - payOrder.WithdrawalMoney
bill := &userBill
if _, err := dao.UpdateEntityTx(tx, &bill, "AccountBalance"); err != nil {
if _, err := dao.UpdateEntityTx(tx, &userBill, "AccountBalance"); err != nil {
globals.SugarLogger.Debug("err=======", err)
dao.Rollback(db, tx)
return err