From 475ca02fd2c2890691861a09679832bbd9856f59 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 15 Jul 2022 14:58:51 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v1.4.7=20=E5=88=86=E4=BD=A3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/relate_commission.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/rule/relate_commission.go b/rule/relate_commission.go index bb723c7..dec227c 100644 --- a/rule/relate_commission.go +++ b/rule/relate_commission.go @@ -150,6 +150,32 @@ func SettleCommWithGoodsDetail(eg *xorm.Engine, dbName string, CommissionParam m profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) return profit, pvdFee, sysFee, subsidyFee, lvUser, err } +func SettleCommWithOrder(eg *xorm.Engine, dbName string, CommissionParam md.CommissionFirstParam) (float64, float64, float64, float64, *comm_plan.LvUser, error) { + var ( + isShare = false + isAllLevelReturn = false + ) + if CommissionParam.IsShare != 0 { + isShare = true + } + + if CommissionParam.IsAllLevelReturn != 0 { + isAllLevelReturn = true + } + var mapData = map[string]string{ + "old_lv": CommissionParam.OldLv, + "new_lv": CommissionParam.NewLv, + "ownbuy_return_type": zhios_order_relate_utils.IntToStr(CommissionParam.OwnbuyReturnType), + } + virCfg, _ := db.SysCfgGetOne(eg, "virtual_coin_rebate_type") + var virType = "price" + if virCfg != nil && virCfg.Val != "" { + virType = virCfg.Val + } + CommissionParam.CommissionParam.Oid = CommissionParam.GoodsId + profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) + return profit, pvdFee, sysFee, subsidyFee, lvUser, err +} //获取自购分享佣金的 func GetRewardCommission(eg *xorm.Engine, dbName, mode string, CommissionParam md.CommissionFirstParam) (float64, float64, *comm_plan.LvUser, error) {