From 22f60a454646b771dfb2ecab6bd9b9d90b2edd8a Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 26 Nov 2019 08:58:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E8=90=A5=E5=BA=97=E5=A7=8B=E7=BB=88?= =?UTF-8?q?=E6=8C=89=E6=AF=94=E4=BE=8B=E7=BB=93=E7=AE=97=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E8=80=83=E8=99=91=E6=B4=BB=E5=8A=A8=E4=B8=8E=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 9 +++++++-- business/jxutils/jxutils_cms.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index baad32e92..19a947619 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -372,9 +372,14 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao. } } } - v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, storePayPercentage) + // 直营店始终按比例结算,不考虑活动与结算表 + salePrice := v.SalePrice + if changePriceType == model.StoreChangePriceTypeManagedStore && v.ShopPrice != 0 { + salePrice = 0 + } + v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, salePrice, storePayPercentage) } - // 直营店始终按比例结算 + // 直营店始终按比例结算,不考虑活动与结算表 if changePriceType != model.StoreChangePriceTypeManagedStore { updateSingleOrderEarningPrice(order, db) } diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index 150e96066..03d9d6951 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -466,7 +466,7 @@ func GetVendorName(vendorID int) (vendorName string) { func CaculateSkuEarningPrice(shopPrice, salePrice int64, storePayPercentage int) (earningPrice int64) { earningPrice = salePrice - if shopPrice > 0 && shopPrice < earningPrice { + if salePrice == 0 || shopPrice > 0 && shopPrice < earningPrice { earningPrice = shopPrice } if storePayPercentage <= 0 {