diff --git a/services/reward/serial.go b/services/reward/serial.go index 349da12660..a1e3d4c7e7 100644 --- a/services/reward/serial.go +++ b/services/reward/serial.go @@ -11,7 +11,7 @@ import ( func GetSerialNoByRedis() (string, error) { now := time.Now() - r := int64(rand.Intn(4)) + 1 + r := int64(rand.Intn(3)) + 1 n, err := redis_client.IncrBy(redis_key.RewardSerialCounter(now), r) if err != nil { log.Error("GetSerialNoByRedis RewardSerialCounter error. %v", err) @@ -20,5 +20,9 @@ func GetSerialNoByRedis() (string, error) { if n == r { 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 { + 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 } diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index bcf46f9f05..cdc2cf5497 100755 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -20,7 +20,7 @@