Pārlūkot izejas kodu

更新

one_orenge
huangjiajun pirms 7 mēnešiem
vecāks
revīzija
303f9c5f37
1 mainītis faili ar 10 papildinājumiem un 10 dzēšanām
  1. +10
    -10
      consume/zhios_order_settle_total.go

+ 10
- 10
consume/zhios_order_settle_total.go Parādīt failu

@@ -124,15 +124,15 @@ func handleZhiosOrderSettleTotal(msg []byte) error {
continue
}
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4)
update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1)
_, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1)
if err1 != nil {
sess.Rollback()
return err
}
if update1 == 0 {
sess.Rollback()
return errors.New("失败")
}
//if update1 == 0 {
// sess.Rollback()
// return errors.New("失败")
//}

var userStatistics2 model.UserMonthAmount
if ordData.SettleAt == 0 {
@@ -156,15 +156,15 @@ func handleZhiosOrderSettleTotal(msg []byte) error {
}
}
userStatistics2.SettleAmount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics2.SettleAmount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4)
update2, err2 := eg.Where("id=?", userStatistics2.Id).Cols("settle_amount").Update(&userStatistics2)
_, err2 := eg.Where("id=?", userStatistics2.Id).Cols("settle_amount").Update(&userStatistics2)
if err2 != nil {
sess.Rollback()
return err2
}
if update2 == 0 {
sess.Rollback()
return errors.New("失败")
}
//if update2 == 0 {
// sess.Rollback()
// return errors.New("失败")
//}
}
}
sess.Commit()


Notiek ielāde…
Atcelt
Saglabāt