1234567891011121314151617 |
- package utils
- func OrderIdRange(OrderId int64) (int64, int64) {
- minOrderId := OrderId //后面有几个零
- var maxStep int64 = 1
- currValue := minOrderId
- for {
- if currValue%10 == 0 {
- currValue = currValue / 10
- maxStep = maxStep * 10
- } else {
- break
- }
- }
- maxOrderId := minOrderId + maxStep - 1
- return minOrderId, maxOrderId
- }
|