1
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user