订单增加成功时间
This commit is contained in:
parent
0f571a3dbe
commit
cf4dc8a812
|
@ -5,6 +5,7 @@ import (
|
||||||
"qteam/app/utils"
|
"qteam/app/utils"
|
||||||
"qteam/app/utils/encrypt"
|
"qteam/app/utils/encrypt"
|
||||||
"qteam/config"
|
"qteam/config"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type OrderCreateRequest struct {
|
type OrderCreateRequest struct {
|
||||||
|
@ -22,24 +23,26 @@ type OrderListRequest struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderListResponse struct {
|
type OrderListResponse struct {
|
||||||
Id int `json:"id"`
|
Id int `json:"id"`
|
||||||
OrderNo string `json:"order_no"`
|
OrderNo string `json:"order_no"`
|
||||||
MainImage string `json:"main_image"`
|
MainImage string `json:"main_image"`
|
||||||
UserId int `json:"user_id"`
|
UserId int `json:"user_id"`
|
||||||
CustNo string `json:"custNo"`
|
CustNo string `json:"custNo"`
|
||||||
Price string `json:"price"`
|
Price string `json:"price"`
|
||||||
ProductId int `json:"product_id"`
|
ProductId int `json:"product_id"`
|
||||||
ProductName string `json:"product_name"`
|
ProductName string `json:"product_name"`
|
||||||
State int `json:"state"`
|
State int `json:"state"`
|
||||||
VoucherLink string `json:"voucher_link"`
|
VoucherLink string `json:"voucher_link"`
|
||||||
CreateTime string `json:"create_time"`
|
CreateTime string `json:"create_time"`
|
||||||
NotifyUrl string `json:"notify_url"`
|
NotifyUrl string `json:"notify_url"`
|
||||||
|
ExchangeTime string `json:"exchange_time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OrderListResponse) ResponseFromDb(l ordersmodel.OrdersProductsList) {
|
func (p *OrderListResponse) ResponseFromDb(l ordersmodel.OrdersProductsList) {
|
||||||
p.Id = l.Id
|
p.Id = l.Id
|
||||||
p.OrderNo = l.OrderNo
|
p.OrderNo = l.OrderNo
|
||||||
p.MainImage = l.MainImage
|
p.MainImage = l.MainImage
|
||||||
|
p.ExchangeTime = l.ExchangeTime.Format(time.DateTime)
|
||||||
p.UserId = l.UserId
|
p.UserId = l.UserId
|
||||||
p.CustNo = l.CustNo
|
p.CustNo = l.CustNo
|
||||||
p.Price = l.Price
|
p.Price = l.Price
|
||||||
|
@ -60,25 +63,27 @@ func (p *OrderListResponse) ResponseFromDb(l ordersmodel.OrdersProductsList) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderQueryResponse struct {
|
type OrderQueryResponse struct {
|
||||||
Id int `json:"id"`
|
Id int `json:"id"`
|
||||||
OrderNo string `json:"order_no"`
|
OrderNo string `json:"order_no"`
|
||||||
UserId int `json:"user_id"`
|
UserId int `json:"user_id"`
|
||||||
UserName string `json:"user_name"`
|
UserName string `json:"user_name"`
|
||||||
Price string `json:"price"`
|
Price string `json:"price"`
|
||||||
MainImage string `json:"main_image"`
|
MainImage string `json:"main_image"`
|
||||||
Mobile string `json:"mobile"`
|
Mobile string `json:"mobile"`
|
||||||
ProductId int `json:"product_id"`
|
ProductId int `json:"product_id"`
|
||||||
ProductName string `json:"product_name"`
|
ProductName string `json:"product_name"`
|
||||||
State int `json:"state"`
|
State int `json:"state"`
|
||||||
VoucherLink string `json:"voucher_link"`
|
VoucherLink string `json:"voucher_link"`
|
||||||
CreateTime string `json:"create_time"`
|
CreateTime string `json:"create_time"`
|
||||||
NotifyUrl string `json:"notify_url"`
|
NotifyUrl string `json:"notify_url"`
|
||||||
|
ExchangeTime string `json:"exchange_time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OrderQueryResponse) ResponseFromDb(l ordersmodel.Orders) {
|
func (p *OrderQueryResponse) ResponseFromDb(l ordersmodel.Orders) {
|
||||||
utils.EntityCopy(p, &l)
|
utils.EntityCopy(p, &l)
|
||||||
p.NotifyUrl = config.GetConf().YouChu.NotifyUrl
|
p.NotifyUrl = config.GetConf().YouChu.NotifyUrl
|
||||||
p.CreateTime = l.CreateTime.Format("2006-01-02 15:04:05")
|
p.CreateTime = l.CreateTime.Format("2006-01-02 15:04:05")
|
||||||
|
p.ExchangeTime = l.ExchangeTime.Format(time.DateTime)
|
||||||
if l.VoucherLink != "" {
|
if l.VoucherLink != "" {
|
||||||
p.VoucherLink = string(encrypt.AesDecryptCBC(l.VoucherLink, []byte(config.GetConf().OpenApiMarketConfig.SecretKey)))
|
p.VoucherLink = string(encrypt.AesDecryptCBC(l.VoucherLink, []byte(config.GetConf().OpenApiMarketConfig.SecretKey)))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue