diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 9b2c33b79..7fc236deb 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -364,6 +364,18 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao. salePrice = 0 } v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, salePrice, storePayPercentage) + //重复购买有结算价的商品需要拆分,第一个商品按结算价,后面的商品按shopprice 或者 saleprice,然后把原来的商品信息删了 + if v.Count > 1 && v.EarningPrice != 0 { + sku := v + sku.Count = v.Count - 1 + v.Count = 1 + if v.ShopPrice < v.SalePrice { + sku.EarningPrice = v.ShopPrice + } else { + sku.EarningPrice = v.SalePrice + } + orderSkus = append(orderSkus, sku) + } } // 直营店始终按比例结算,不考虑活动与结算表 if changePriceType != model.StoreChangePriceTypeManagedStore { diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index a270c70e5..9c079cfbc 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -430,9 +430,9 @@ func (c *OrderManager) ExportOrders(ctx *jxcontext.Context, fromDateStr, toDateS "waybillCreatedAt", "waybillFinishedAt", "status2", - "skuInfo", - "waybillTipMoney", "skuInfo2", + "waybillTipMoney", + // "skuInfo2", }, } excelBin = excel.Obj2Excel([]*excel.Obj2ExcelSheetConfig{excelConf})