订单增加成功时间

This commit is contained in:
qiyunfanbo126.com 2024-07-26 09:25:31 +08:00
parent 0f571a3dbe
commit cf4dc8a812
1 changed files with 30 additions and 25 deletions

View File

@ -5,6 +5,7 @@ import (
"qteam/app/utils"
"qteam/app/utils/encrypt"
"qteam/config"
"time"
)
type OrderCreateRequest struct {
@ -34,12 +35,14 @@ type OrderListResponse struct {
VoucherLink string `json:"voucher_link"`
CreateTime string `json:"create_time"`
NotifyUrl string `json:"notify_url"`
ExchangeTime string `json:"exchange_time"`
}
func (p *OrderListResponse) ResponseFromDb(l ordersmodel.OrdersProductsList) {
p.Id = l.Id
p.OrderNo = l.OrderNo
p.MainImage = l.MainImage
p.ExchangeTime = l.ExchangeTime.Format(time.DateTime)
p.UserId = l.UserId
p.CustNo = l.CustNo
p.Price = l.Price
@ -73,12 +76,14 @@ type OrderQueryResponse struct {
VoucherLink string `json:"voucher_link"`
CreateTime string `json:"create_time"`
NotifyUrl string `json:"notify_url"`
ExchangeTime string `json:"exchange_time"`
}
func (p *OrderQueryResponse) ResponseFromDb(l ordersmodel.Orders) {
utils.EntityCopy(p, &l)
p.NotifyUrl = config.GetConf().YouChu.NotifyUrl
p.CreateTime = l.CreateTime.Format("2006-01-02 15:04:05")
p.ExchangeTime = l.ExchangeTime.Format(time.DateTime)
if l.VoucherLink != "" {
p.VoucherLink = string(encrypt.AesDecryptCBC(l.VoucherLink, []byte(config.GetConf().OpenApiMarketConfig.SecretKey)))
}