浏览代码

更新

one_orenge
huangjiajun 7 个月前
父节点
当前提交
303f9c5f37
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. +10
    -10
      consume/zhios_order_settle_total.go

+ 10
- 10
consume/zhios_order_settle_total.go 查看文件

@@ -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()


正在加载...
取消
保存