Browse Source

更新

master
huangjiajun 4 months ago
parent
commit
13bd60b4d8
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      consume/zhios_order_total_second.go

+ 10
- 2
consume/zhios_order_total_second.go View File

@@ -93,7 +93,10 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
sess.Rollback()
return nil
}

if ordData.IsTotal == 0 && ordData.State == 4 {
sess.Rollback()
return nil
}
now := time.Unix(int64(ordData.CreateAt), 0).Format("200601")
nowDay := time.Unix(int64(ordData.CreateAt), 0).Format("20060102")
isTotal := ordData.IsTotal
@@ -306,8 +309,13 @@ func handleZhiosOrderTotalSecond(msg []byte) error {
}
}
}
oldTotal := ordData.IsTotal
ordData.IsTotal = isTotal
sess.Where("ord_id=?", ordData.OrdId).Update(ordData)
update, err := sess.Where("ord_id=?", ordData.OrdId).Update(ordData)
if (update == 0 && isTotal != oldTotal) || err != nil {
sess.Rollback()
return err
}
sess.Commit()
return nil
}

Loading…
Cancel
Save