From 726e5c068676e4458bec0412ec32d1806d60933a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 6 May 2020 14:50:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E4=BB=B7?= =?UTF-8?q?=EF=BC=8C=E8=8B=A5=E6=95=B0=E9=87=8F=E5=A4=A7=E4=BA=8E1?= =?UTF-8?q?=E4=B8=94=E7=BB=93=E7=AE=97=E4=BB=B7=E4=B8=8D=E4=B8=BA0?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E8=BF=9B=E8=A1=8C=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 12 ++++++++++++ business/jxcallback/orderman/orderman_ext.go | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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})