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 {