1
This commit is contained in:
@@ -79,9 +79,9 @@ func (v *BillExpend) TableIndex() [][]string {
|
|||||||
type UserBill struct {
|
type UserBill struct {
|
||||||
ModelIDCULD
|
ModelIDCULD
|
||||||
|
|
||||||
BillID int64 `orm:"column(bill_id)" json:"billID"` //账单ID
|
BillID int64 `orm:"column(bill_id)" json:"billID"` //账单ID
|
||||||
UserID string `orm:"column(user_id)" json:"userID"` //用户ID
|
UserID string `orm:"column(user_id)" json:"userID"` //用户ID
|
||||||
AccountBalance int `json:"accountBalance"` //账户余额
|
AccountBalance int `orm:"column(account_balance)" json:"accountBalance"` //账户余额
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *UserBill) TableUnique() [][]string {
|
func (v *UserBill) TableUnique() [][]string {
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ func UpdateUserMoney(payOrder *model.WithdrawalRecord, userBill *model.UserBill)
|
|||||||
switch payOrder.OrderStatus {
|
switch payOrder.OrderStatus {
|
||||||
case model.WithdrawalRecordPaySuccess:
|
case model.WithdrawalRecordPaySuccess:
|
||||||
userBill.AccountBalance = userBill.AccountBalance - payOrder.WithdrawalMoney
|
userBill.AccountBalance = userBill.AccountBalance - payOrder.WithdrawalMoney
|
||||||
bill := &userBill
|
if _, err := dao.UpdateEntityTx(tx, &userBill, "AccountBalance"); err != nil {
|
||||||
if _, err := dao.UpdateEntityTx(tx, &bill, "AccountBalance"); err != nil {
|
|
||||||
globals.SugarLogger.Debug("err=======", err)
|
globals.SugarLogger.Debug("err=======", err)
|
||||||
dao.Rollback(db, tx)
|
dao.Rollback(db, tx)
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user