Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
02b3788dc9
|
@ -97,7 +97,7 @@ type OrderStatus struct {
|
||||||
type OrderProduct struct {
|
type OrderProduct struct {
|
||||||
TotalPrice AmountInfo `json:"amount"` // 商品总价
|
TotalPrice AmountInfo `json:"amount"` // 商品总价
|
||||||
ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间
|
ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` // 购买数量
|
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
||||||
ProductID int64 `json:"product_id"` // 商品ID
|
ProductID int64 `json:"product_id"` // 商品ID
|
||||||
ProductName string `json:"product_name"` // 商品名称
|
ProductName string `json:"product_name"` // 商品名称
|
||||||
ItemPrice AmountInfo `json:"product_price"` // 商品单价
|
ItemPrice AmountInfo `json:"product_price"` // 商品单价
|
||||||
|
@ -112,6 +112,10 @@ type OrderProduct struct {
|
||||||
StepNum []int `json:"step_num"` // 阶梯数量
|
StepNum []int `json:"step_num"` // 阶梯数量
|
||||||
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
||||||
}
|
}
|
||||||
|
type PurchaseQuantity struct {
|
||||||
|
Current interface{} `json:"current"`
|
||||||
|
Initiate interface{} `json:"initiate"`
|
||||||
|
}
|
||||||
|
|
||||||
type OrderProductSizeInfo struct {
|
type OrderProductSizeInfo struct {
|
||||||
SizeID int64 `json:"size_id"`
|
SizeID int64 `json:"size_id"`
|
||||||
|
|
|
@ -863,7 +863,10 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
|
||||||
OriginalCurrency: in.OriginalCurrency,
|
OriginalCurrency: in.OriginalCurrency,
|
||||||
}),
|
}),
|
||||||
ExpectedDeliveryTime: &in.ExpectedDeliveryTime,
|
ExpectedDeliveryTime: &in.ExpectedDeliveryTime,
|
||||||
PurchaseQuantity: *shoppingCart.PurchaseQuantity,
|
PurchaseQuantity: gmodel.PurchaseQuantity{
|
||||||
|
Current: *shoppingCart.PurchaseQuantity,
|
||||||
|
Initiate: *shoppingCart.PurchaseQuantity,
|
||||||
|
},
|
||||||
ProductID: *shoppingCart.ProductId,
|
ProductID: *shoppingCart.ProductId,
|
||||||
ProductCover: *shoppingCart.ShoppingCartProduct.Cover,
|
ProductCover: *shoppingCart.ShoppingCartProduct.Cover,
|
||||||
ProductCoverMetadata: productCoverMetadata,
|
ProductCoverMetadata: productCoverMetadata,
|
||||||
|
@ -1032,7 +1035,8 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
|
||||||
if original == 1 {
|
if original == 1 {
|
||||||
for orderProductKey, orderProduct := range orderDetail.OrderProduct {
|
for orderProductKey, orderProduct := range orderDetail.OrderProduct {
|
||||||
orderDetail.OrderProduct[orderProductKey].TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
orderDetail.OrderProduct[orderProductKey].TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
||||||
orderDetail.OrderProduct[orderProductKey].ItemPrice = order.GetAmountInfoFormat(&orderProduct.ItemPrice)
|
orderDetail.OrderProduct[orderProductKey].TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
||||||
|
orderDetail.OrderProduct[orderProductKey].PurchaseQuantity = order.GetPurchaseQuantity(&orderProduct.PurchaseQuantity)
|
||||||
orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot = nil
|
orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot = nil
|
||||||
orderDetail.OrderProduct[orderProductKey].ProductSnapshot = nil
|
orderDetail.OrderProduct[orderProductKey].ProductSnapshot = nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fusenapi/constants"
|
"fusenapi/constants"
|
||||||
"fusenapi/model/gmodel"
|
"fusenapi/model/gmodel"
|
||||||
"fusenapi/utils/format"
|
"fusenapi/utils/format"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -112,6 +113,14 @@ func GetAmountInfoFormat(req *gmodel.AmountInfo) gmodel.AmountInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理商品数量
|
||||||
|
func GetPurchaseQuantity(req *gmodel.PurchaseQuantity) gmodel.PurchaseQuantity {
|
||||||
|
return gmodel.PurchaseQuantity{
|
||||||
|
Initiate: strconv.FormatInt(int64(req.Initiate.(float64)), 10),
|
||||||
|
Current: strconv.FormatInt(int64(req.Current.(float64)), 10),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 生成订单编号
|
// 生成订单编号
|
||||||
func GenerateOrderNumber() string {
|
func GenerateOrderNumber() string {
|
||||||
t := time.Now()
|
t := time.Now()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user