Compare commits

..

No commits in common. "d8c083f5b671b99ca77ec6ac6a87da534e4e2a5b" and "0f1559f1cf0282de5f911801b7b096acab89f374" have entirely different histories.

3 changed files with 2 additions and 20 deletions

View File

@ -3,12 +3,9 @@ package common
import (
"fmt"
"go.uber.org/zap"
"math/rand"
"time"
)
const source = "0123456789abcdefghijklmnopqrstUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
// GetBeijingTime 获取当前时间的北京时间
func GetBeijingTime() string {
// 获取当前时间
@ -29,18 +26,3 @@ func GetBeijingTime() string {
return beijingTime
}
func GetZeroUuid() string {
id := time.Now().Format("20060102150405") + GetRandomstring(6)
result := "ZERO_" + id
return result
}
func GetRandomstring(length int) string {
rand.Seed(time.Now().UnixNano())
bytes := make([]byte, length)
for i := 0; i < length; i++ {
bytes[i] = source[rand.Intn(62)]
}
return string(bytes)
}

View File

@ -334,7 +334,7 @@ func CreateAntomPay(c *gin.Context) {
PayStatus: 2,
PayTime: common.GetBeijingTime(),
UserID: userInfo.ID,
SerialNumber: common.GetZeroUuid(),
SerialNumber: "zero-price-serial-number",
})
if err != nil {
fmt.Println("=============== antom创建支付创建对账单报错", err)

View File

@ -319,7 +319,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
PayStatus: 2,
PayTime: unfinishInfo.PayTime,
UserID: uint64(userResp.UserId),
SerialNumber: unfinishInfo.OrderNo,
SerialNumber: "zero-price-serial-number",
})
if err != nil {
fmt.Println("=============== antom创建支付创建对账单报错", err)