Browse Source

更新

master
huangjiajun 5 months ago
parent
commit
edb05c407d
1 changed files with 12 additions and 12 deletions
  1. +12
    -12
      consume/zhios_order_total_second.go

+ 12
- 12
consume/zhios_order_total_second.go View File

@@ -138,12 +138,12 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
if ordData.State == 4 && ordData.IsTotal == 1 { if ordData.State == 4 && ordData.IsTotal == 1 {
isupdate = 1 isupdate = 1
isTotal = 2 isTotal = 2
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4)
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 6)
} }
if ordData.State != 4 && ordData.IsTotal == 0 { if ordData.State != 4 && ordData.IsTotal == 0 {
isupdate = 1 isupdate = 1
isTotal = 1 isTotal = 1
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4)
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 6)
} }
update, err := sess.Where("id=?", userStatistics.Id).Cols("amount").Update(&userStatistics) update, err := sess.Where("id=?", userStatistics.Id).Cols("amount").Update(&userStatistics)
if err != nil { if err != nil {
@@ -177,11 +177,11 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
isupdate1 := 0 isupdate1 := 0
if ordData.State == 4 && ordData.IsTotal == 1 { if ordData.State == 4 && ordData.IsTotal == 1 {
isupdate1 = 1 isupdate1 = 1
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 6)
} }
if ordData.State != 4 && ordData.IsTotal == 0 { if ordData.State != 4 && ordData.IsTotal == 0 {
isupdate1 = 1 isupdate1 = 1
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 6)
} }
update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1) update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1)
if err1 != nil { if err1 != nil {
@@ -212,11 +212,11 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
isupdate1 := 0 isupdate1 := 0
if ordData.State == 4 && ordData.IsTotal == 1 { if ordData.State == 4 && ordData.IsTotal == 1 {
isupdate1 = 1 isupdate1 = 1
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 6)
} }
if ordData.State != 4 && ordData.IsTotal == 0 { if ordData.State != 4 && ordData.IsTotal == 0 {
isupdate1 = 1 isupdate1 = 1
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 6)
} }
update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1) update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1)
if err1 != nil { if err1 != nil {
@@ -260,15 +260,15 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
} }
if ordData.State == 4 && (ordData.IsTotal == 1 || ordData.IsTotal == 3) { if ordData.State == 4 && (ordData.IsTotal == 1 || ordData.IsTotal == 3) {
isTotal = 2 isTotal = 2
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.AfterAmount), 4)
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.AfterAmount), 6)
} }
if ordData.State != 4 && (ordData.IsTotal == 0) { if ordData.State != 4 && (ordData.IsTotal == 0) {
isTotal = 3 isTotal = 3
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+utils.StrToFloat64(v.AfterAmount), 4)
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+utils.StrToFloat64(v.AfterAmount), 6)
} }
if ordData.State != 4 && (ordData.IsTotal == 1) { if ordData.State != 4 && (ordData.IsTotal == 1) {
isTotal = 3 isTotal = 3
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.Amount), 4)
userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.Amount), 6)
} }
_, err := sess.Where("id=?", userStatistics.Id).Cols("amount").Update(&userStatistics) _, err := sess.Where("id=?", userStatistics.Id).Cols("amount").Update(&userStatistics)
if err != nil { if err != nil {
@@ -293,15 +293,15 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
} }
if ordData.State == 4 && (ordData.IsTotal == 1 || ordData.IsTotal == 3) { if ordData.State == 4 && (ordData.IsTotal == 1 || ordData.IsTotal == 3) {
isTotal = 2 isTotal = 2
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.AfterAmount), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.AfterAmount), 6)
} }
if ordData.State != 4 && (ordData.IsTotal == 0) { if ordData.State != 4 && (ordData.IsTotal == 0) {
isTotal = 3 isTotal = 3
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+utils.StrToFloat64(v.AfterAmount), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+utils.StrToFloat64(v.AfterAmount), 6)
} }
if ordData.State != 4 && (ordData.IsTotal == 1) { if ordData.State != 4 && (ordData.IsTotal == 1) {
isTotal = 3 isTotal = 3
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.Amount), 4)
userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.Amount), 6)
} }
_, err = sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics) _, err = sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics)
if err != nil { if err != nil {


Loading…
Cancel
Save