Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-11-02 15:00:48 +08:00
commit 8d49d4f164

View File

@ -1769,14 +1769,10 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
StatusLink: order.GetOrderStatusLinkUser(*orderInfo.DeliveryMethod, statusLink), StatusLink: order.GetOrderStatusLinkUser(*orderInfo.DeliveryMethod, statusLink),
Metadata: orderMetadata, Metadata: orderMetadata,
} }
// 购物车对应商品
var orderProductList []gmodel.OrderProduct var shoppingCartSnapshotDataMap = make(map[int64]gmodel.FsShoppingCartData, len(shoppingCartSnapshot))
for _, productValue := range orderProduct {
var selectColorIndex int64
var shoppingCartSnapshotData gmodel.FsShoppingCartData
for _, shoppingCartSnapshotValue := range shoppingCartSnapshot { for _, shoppingCartSnapshotValue := range shoppingCartSnapshot {
if productValue.CartId == shoppingCartSnapshotValue.Id { var shoppingCartSnapshotData gmodel.FsShoppingCartData
snapshot, err := d.OrderShoppingCartSnapshotHandler(ctx, shoppingCartSnapshotValue.Snapshot) snapshot, err := d.OrderShoppingCartSnapshotHandler(ctx, shoppingCartSnapshotValue.Snapshot)
if err != nil { if err != nil {
logc.Errorf(ctx, "OrderDetailHandler OrderShoppingCartSnapshotHandler failed, err: %v", err) logc.Errorf(ctx, "OrderDetailHandler OrderShoppingCartSnapshotHandler failed, err: %v", err)
@ -1797,14 +1793,21 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
shoppingCartSnapshotData.Ctime = shoppingCartSnapshotValue.Ctime shoppingCartSnapshotData.Ctime = shoppingCartSnapshotValue.Ctime
shoppingCartSnapshotData.Utime = shoppingCartSnapshotValue.Utime shoppingCartSnapshotData.Utime = shoppingCartSnapshotValue.Utime
shoppingCartSnapshotData.Snapshot = &snapshot shoppingCartSnapshotData.Snapshot = &snapshot
shoppingCartSnapshotDataMap[shoppingCartSnapshotValue.Id] = shoppingCartSnapshotData
selectColorIndexV, selectColorIndexE := snapshot["select_color_index"] }
var orderProductList []gmodel.OrderProduct
for _, productValue := range orderProduct {
var selectColorIndex int64
var shoppingCartSnapshotData = shoppingCartSnapshotDataMap[productValue.CartId]
var snapshotInfo = shoppingCartSnapshotData.Snapshot
if snapshotInfo != nil {
var snapshotInfoMap = *snapshotInfo
selectColorIndexV, selectColorIndexE := snapshotInfoMap["select_color_index"]
if selectColorIndexE { if selectColorIndexE {
selectColorIndex = selectColorIndexV.(int64) selectColorIndex = selectColorIndexV.(int64)
} }
}
}
}
var expectedDeliveryTime time.Time var expectedDeliveryTime time.Time
if productValue.ExpectedDeliveryTime == nil { if productValue.ExpectedDeliveryTime == nil {
expectedDeliveryTime = expectedTime expectedDeliveryTime = expectedTime