From f23cb892c03d96c56b202796bb82d646ace6fd38 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, 19 Jun 2020 09:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=9C=E5=9B=AD=E8=AE=A2=E5=8D=95=E5=88=A9?= =?UTF-8?q?=E6=B6=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/scheduler/defsch/defsch.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index ab88ab3eb..643de03df 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -6,6 +6,8 @@ import ( "sync" "time" + "github.com/astaxie/beego" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" "git.rosy.net.cn/jx-callback/business/authz" @@ -1446,10 +1448,18 @@ func OrderProfitWarning(order *model.GoodsOrder) { storeDetail, err := dao.GetStoreDetail(db, storeID, order.VendorID) if storeDetail != nil && err == nil { payPercentage := storeDetail.PayPercentage - if payPercentage >= 50 { - profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.ShopPrice)) / 100 + if beego.BConfig.RunMode == "jxgy" { + if payPercentage >= 50 { + profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.EarningPrice)) / 100 + } else { + profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100 + } } else { - profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100 + if payPercentage >= 50 { + profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.ShopPrice)) / 100 + } else { + profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100 + } } if profit < 0 { operatorPhone, operatorName := getOrderOperatorInfo(order, storeDetail)