Files
mir-godot/server/framework/utils/order.go

27 lines
675 B
Go
Raw Normal View History

2024-03-06 10:47:22 +08:00
/**
#*****************************************************************************
# @file order.go
# @author MakerYang(https://www.makeryang.com)
# @statement 免费课程配套开源项目任何形式收费均为盗版
#*****************************************************************************
*/
2024-03-03 22:59:18 +08:00
package Utils
import (
"math/rand"
"time"
)
func CreateOrderNum() string {
str := "0123456789"
bytes := []byte(str)
result := make([]byte, 0)
r := rand.New(rand.NewSource(time.Now().UnixNano()))
for i := 0; i < 8; i++ {
result = append(result, bytes[r.Intn(len(bytes))])
}
order := time.Now().Format("20060102150405") + string(result)
return order
}