From 1e527a601bdf169ac4af17801daf3b6f83981db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 20 Mar 2020 09:35:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=90=A5=E4=B8=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/orderman_ext.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 85e2ec9f1..e64b02eb3 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -651,7 +651,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID if len(skuList) > 0 { flagVendorOrderID = skuList[0].VendorOrderID } - for _, v := range skuList { + for k, v := range skuList { if v.EarningPrice == 0 { v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, v.PayPercentage) } @@ -675,7 +675,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID saleInfo.SalePrice += v.SalePrice * int64(v.Count) // saleInfo.EarningPrice += v.EarningPrice * int64(v.Count) if v.VendorOrderID == flagVendorOrderID { - if len(skuList) == 1 { + if k == 0 { saleInfo.EarningPrice = v.NewEarningPrice } } else { @@ -733,7 +733,6 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID order.VendorPrice += orderSku.VendorPrice * int64(v.Count) order.SalePrice += orderSku.SalePrice * int64(v.Count) order.EarningPrice += orderSku.EarningPrice * int64(v.Count) - globals.SugarLogger.Debugf("GetStoresOrderSaleInfoNew", utils.Format4Output(order, false)) } else { // globals.SugarLogger.Debug(utils.Format4Output(v, true)) } @@ -757,7 +756,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID saleInfo.ShopPrice += v.ShopPrice saleInfo.VendorPrice += v.VendorPrice saleInfo.SalePrice += v.SalePrice - // saleInfo.EarningPrice += v.EarningPrice + saleInfo.EarningPrice += v.EarningPrice saleInfo.Count++ } for _, v := range saleInfoMap {