From 6c7aeded6c8291796b65cf9992f126ecccd035a2 Mon Sep 17 00:00:00 2001 From: "qiyunfanbo126.com" <815699> Date: Tue, 22 Oct 2024 15:44:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=93=81=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/util.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/util.go b/app/utils/util.go index 20ff6a8..e1ae68d 100644 --- a/app/utils/util.go +++ b/app/utils/util.go @@ -355,11 +355,11 @@ func GenerateOrderNumber() string { // 生成随机数部分(4位随机数) mrand.Seed(time.Now().UnixNano()) - randomPart := fmt.Sprintf("%04d", mrand.Intn(10000)) + randomPart := fmt.Sprintf("%06d", mrand.Intn(100000)) // 添加固定前缀 - prefix := "SN" - + //prefix := "SN" + prefix := "" // 最终的订单号由前缀、日期和随机数部分组成 orderNumber := fmt.Sprintf("%s%s%s", prefix, datePart, randomPart)