From 39ba090f88dc805053e67186c825a8ba37d63b0f 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, 15 May 2020 13:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E7=BB=93=E7=AE=97=E4=BB=B7ne?= =?UTF-8?q?wearningprice=E4=B9=9F=E8=A6=81=E5=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 88e899361..c53a00978 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -784,7 +784,20 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, } } jxutils.RefreshOrderSkuRelated(order) - num, err := dao.UpdateEntity(db, order, "EarningPrice") + storeID := 0 + if order.StoreID == 0 { + storeID = order.JxStoreID + } else { + storeID = order.StoreID + } + store, _ := dao.GetStoreDetail(db, storeID, order.VendorID) + payPercentage := store.PayPercentage + if payPercentage <= 50 { + order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage/2)) / 100 + } else { + order.NewEarningPrice = order.EarningPrice + } + num, err := dao.UpdateEntity(db, order, "EarningPrice", "NewEarningPrice") if err != nil { return nil, err }