一个余额
This commit is contained in:
@@ -43,15 +43,15 @@ func OnPayFinished(order *model.Order) (err error) {
|
||||
}
|
||||
//根据订单类型来操作账户
|
||||
switch order.Type {
|
||||
case model.OrderTypeDeposit:
|
||||
//如果是发布任务的保证金
|
||||
case model.OrderTypeAccount:
|
||||
//如果是账户充值(发布任务等)
|
||||
//1、账户收入表增加一条保证金记录
|
||||
if err = AddBillIncome(db, billID, order.Type, order.PayPrice); err != nil {
|
||||
dao.Rollback(db)
|
||||
}
|
||||
//2、账户表保证金总额增加相应值
|
||||
userBill.DepositBalance += order.PayPrice
|
||||
if _, err = dao.UpdateEntity(db, userBill, "DepositBalance"); err != nil {
|
||||
userBill.AccountBalance += order.PayPrice
|
||||
if _, err = dao.UpdateEntity(db, userBill, "AccountBalance"); err != nil {
|
||||
dao.Rollback(db)
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user