From 6b5eed268bdfd16d79fbbbd16c69829cf53f9606 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 15 Sep 2022 09:43:09 +0800 Subject: [PATCH] #1249 Optimized the generation of serial numbers --- services/reward/serial.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/reward/serial.go b/services/reward/serial.go index a4679ebd4..a1e3d4c7e 100644 --- a/services/reward/serial.go +++ b/services/reward/serial.go @@ -21,7 +21,7 @@ func GetSerialNoByRedis() (string, error) { redis_client.Expire(redis_key.RewardSerialCounter(now), 2*time.Minute) } //when the counter n exceeds 1000, the length of the serial number will become longer - if n > 1000 { + if n >= 1000 { return now.Format("200601021504") + fmt.Sprintf("%d", n) + fmt.Sprint(rand.Intn(10)), nil } return now.Format("200601021504") + fmt.Sprintf("%03d", n) + fmt.Sprint(rand.Intn(10)), nil