From bdc99553d5e89c185d7225e1617e2bbf97c82c3c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 30 Nov 2023 09:29:56 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/appreciation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rule/appreciation.go b/rule/appreciation.go index 377309c..6dfb11e 100644 --- a/rule/appreciation.go +++ b/rule/appreciation.go @@ -85,6 +85,6 @@ func DealWithdrawalAndDestroy(session *xorm.Session, feeMap md.DealWithdrawalFee resp.TransferOutValue, _ = decimal.NewFromFloat(transferOut).Mul(decimal.NewFromFloat(nowValue)).Float64() resp.AmountOut, _ = transferOutValue.Mul(decimal.NewFromFloat(nowValue)).Float64() resp.DestroyValue, _ = destroyValue.Float64() - resp.RefluxValue, _ = refluxValue.Float64() + resp.RefluxValue, _ = refluxValue.Mul(decimal.NewFromFloat(nowValue)).Float64() return } From 5bddceec2f47076c410362c0b35a1bc40556da05 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 30 Nov 2023 09:59:05 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/appreciation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rule/appreciation.go b/rule/appreciation.go index 6dfb11e..377309c 100644 --- a/rule/appreciation.go +++ b/rule/appreciation.go @@ -85,6 +85,6 @@ func DealWithdrawalAndDestroy(session *xorm.Session, feeMap md.DealWithdrawalFee resp.TransferOutValue, _ = decimal.NewFromFloat(transferOut).Mul(decimal.NewFromFloat(nowValue)).Float64() resp.AmountOut, _ = transferOutValue.Mul(decimal.NewFromFloat(nowValue)).Float64() resp.DestroyValue, _ = destroyValue.Float64() - resp.RefluxValue, _ = refluxValue.Mul(decimal.NewFromFloat(nowValue)).Float64() + resp.RefluxValue, _ = refluxValue.Float64() return } From 71fc70fb55051345093703b143e63b12b92a1e10 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 30 Nov 2023 10:01:09 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/appreciation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rule/appreciation.go b/rule/appreciation.go index 377309c..6dfb11e 100644 --- a/rule/appreciation.go +++ b/rule/appreciation.go @@ -85,6 +85,6 @@ func DealWithdrawalAndDestroy(session *xorm.Session, feeMap md.DealWithdrawalFee resp.TransferOutValue, _ = decimal.NewFromFloat(transferOut).Mul(decimal.NewFromFloat(nowValue)).Float64() resp.AmountOut, _ = transferOutValue.Mul(decimal.NewFromFloat(nowValue)).Float64() resp.DestroyValue, _ = destroyValue.Float64() - resp.RefluxValue, _ = refluxValue.Float64() + resp.RefluxValue, _ = refluxValue.Mul(decimal.NewFromFloat(nowValue)).Float64() return } From 390574ccfaaf2b43f99ae1e7266ae5760236746e Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 7 Dec 2023 09:30:14 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md/provider.go | 21 +++++++++++---------- svc/get_plan_cfg.go | 16 ++++++++++------ svc/reward_commission.go | 7 +++---- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/md/provider.go b/md/provider.go index 98d18f4..bdee453 100644 --- a/md/provider.go +++ b/md/provider.go @@ -1,16 +1,17 @@ package md const ( - PVD_TB = "taobao" - PVD_JD = "jd" - PVD_SN = "suning" - PVD_VIP = "vip" - PVD_PDD = "pdd" - PVD_KL = "kaola" - PVD_TM = "tmall" - PVD_DTK = "dataoke" - PVD_HDK = "haodanku" - PVD_JTT = "jingtuitui" + PVD_TB = "taobao" + PVD_JD = "jd" + PVD_JDOwn = "jd_own" + PVD_SN = "suning" + PVD_VIP = "vip" + PVD_PDD = "pdd" + PVD_KL = "kaola" + PVD_TM = "tmall" + PVD_DTK = "dataoke" + PVD_HDK = "haodanku" + PVD_JTT = "jingtuitui" // 特殊活动免单方案 PVD_FREE = "free" PVD_MEITUAN = "meituan" diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 1301bbf..067c08c 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -20,12 +20,13 @@ var pvdCfgList = map[string]struct { SK string Sid string }{ - md.PVD_TB: {"third_taobao_svc_ak", "third_taobao_svc_sk", "third_taobao_web_sid"}, - md.PVD_KL: {md.KEY_CFG_KL_AK, md.KEY_CFG_KL_SK, ""}, - md.PVD_SN: {md.KEY_CFG_SN_AK, md.KEY_CFG_SN_SK, ""}, - md.PVD_JD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, - md.PVD_PDD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, - md.PVD_VIP: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, + md.PVD_TB: {"third_taobao_svc_ak", "third_taobao_svc_sk", "third_taobao_web_sid"}, + md.PVD_KL: {md.KEY_CFG_KL_AK, md.KEY_CFG_KL_SK, ""}, + md.PVD_SN: {md.KEY_CFG_SN_AK, md.KEY_CFG_SN_SK, ""}, + md.PVD_JD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, + md.PVD_JDOwn: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, + md.PVD_PDD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, + md.PVD_VIP: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, } func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, map[int]*model.PlanCommission, map[int]string) { @@ -82,6 +83,9 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo rewardOpt = rewardOpts["kuaishouTeam"] } } + if pvd == md.PVD_JDOwn && rewardOpts["jd_own"] == nil { + rewardOpt = rewardOpts["jd"] + } if rewardOpt == nil { return nil, zhios_order_relate_logx.Warn("找不到方案记录") } diff --git a/svc/reward_commission.go b/svc/reward_commission.go index 2262f7a..2687fe4 100644 --- a/svc/reward_commission.go +++ b/svc/reward_commission.go @@ -20,7 +20,7 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b virType := commArr["virType"] if virType == "commission" { rmd.PaidPrice = rmd.Commission - if zhios_order_relate_utils.InArr(provider, []string{md.PVD_TB, md.PVD_TM, md.PVD_PDD, md.PVD_SN, md.PVD_KL, md.PVD_JD, md.PVD_VIP}) == false { + if zhios_order_relate_utils.InArr(provider, []string{md.PVD_TB, md.PVD_TM, md.PVD_PDD, md.PVD_SN, md.PVD_KL, md.PVD_JD, md.PVD_JDOwn, md.PVD_VIP}) == false { rmd.GoodsPrice = rmd.Commission } } @@ -78,7 +78,6 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b if cfg == nil { return 0, 0, 0, 0, nil, errors.New("分佣方案未设置") } - // 获取全部佣金 com, price := getCommission(rmd, provider) fmt.Println(com) @@ -469,7 +468,7 @@ func getCommission(d *md.CommissionParam, provider string) (string, string) { commissionRateF := zhios_order_relate_utils.StrToFloat64(d.CommissionRate) / 100 com := currentPriceF * commissionRateF return zhios_order_relate_utils.Float64ToStr(com), currentPrice - case md.PVD_JD: + case md.PVD_JD, md.PVD_JDOwn: if zhios_order_relate_utils.StrToFloat64(d.GoodsPrice) == 0 { //如果价格没有直接返回佣金 return d.Commission, d.PaidPrice @@ -539,7 +538,7 @@ func currentPrice(m *md.CommissionParam, pvd string) string { return zhios_order_relate_utils.Float64ToStr(price) } return m.WlGoodsPrice - case md.PVD_JD: + case md.PVD_JD, md.PVD_JDOwn: //fmt.Println(m.LowestCouponPrice, m.LowerPrice, m.WlGoodsPrice) if m.LowestCouponPrice == "" { if m.CouponPrice != "" { From b6bb92af4255d70ad439221c7552ad9adac1f7a5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 7 Dec 2023 09:30:46 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/get_plan_cfg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 067c08c..e838aa9 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -83,7 +83,7 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo rewardOpt = rewardOpts["kuaishouTeam"] } } - if pvd == md.PVD_JDOwn && rewardOpts["jd_own"] == nil { + if pvd == md.PVD_JDOwn && (rewardOpts["jd_own"] == nil || (rewardOpts["jd_own"] != nil && rewardOpts["jd_own"].PlanCommissionId == 0)) { rewardOpt = rewardOpts["jd"] } if rewardOpt == nil { From 977eca804ac206078a4f5a9076ccafe18ef4771e Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 8 Dec 2023 10:08:00 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/relate_commission.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rule/relate_commission.go b/rule/relate_commission.go index c40480c..3c313d0 100644 --- a/rule/relate_commission.go +++ b/rule/relate_commission.go @@ -278,7 +278,12 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar } param.CommissionParam.ShowLevel = param.ShowLevel param.CommissionParam.Oid = param.Oid - profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(engine, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, commArr, plan, commission, virtualCoinMoneyRate) + var mapData = map[string]string{ + "old_lv": param.OldLv, + "new_lv": param.NewLv, + "ownbuy_return_type": zhios_order_relate_utils.IntToStr(param.OwnbuyReturnType), + } + profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(engine, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, mapData, commArr, plan, commission, virtualCoinMoneyRate) if err != nil { return err } From 7d1361e1b87529a6d31d00dcd9c80dc20be4c919 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 10 Dec 2023 23:35:00 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/model/user_virtual_coin_flow.go | 35 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/db/model/user_virtual_coin_flow.go b/db/model/user_virtual_coin_flow.go index 370db00..bdcc2f0 100644 --- a/db/model/user_virtual_coin_flow.go +++ b/db/model/user_virtual_coin_flow.go @@ -5,22 +5,21 @@ import ( ) type UserVirtualCoinFlow struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` - Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"` - CoinId int `json:"coin_id" xorm:"not null comment('虚拟币id') INT(11)"` - Direction int `json:"direction" xorm:"not null comment('方向:1收入 2支出') TINYINT(255)"` - Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"` - OrdId string `json:"ord_id" xorm:"comment('相关的订单id') VARCHAR(255)"` - Amout string `json:"amout" xorm:"not null comment('变更数量') DECIMAL(16,6)"` - BeforeAmout string `json:"before_amout" xorm:"not null comment('变更前数量') DECIMAL(16,6)"` - AfterAmout string `json:"after_amout" xorm:"not null comment('变更后数量') DECIMAL(16,6)"` - SysFee string `json:"sys_fee" xorm:"not null default 0.000000 comment('手续费') DECIMAL(16,6)"` - CoinTransferData string `json:"coin_transfer_data" xorm:"not null comment('虚拟币转赠信息') TEXT"` - CreateTime time.Time `json:"create_time" xorm:"created default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` - TransferType int `json:"transfer_type" xorm:"comment('转账类型:1全球分红,2管理员修改,3消费,4退回,5虚拟币兑换') TINYINT(100)"` - CoinIdTo int `json:"coin_id_to" xorm:"not null default 0 comment('兑换时目标币种id') INT(11)"` - IsRevoke int `json:"is_revoke" xorm:"not null default 0 comment('转赠是否撤回') INT(1)"` - TransferId int `json:"transfer_id" xorm:"not null default 0 comment('转赠关联id') INT(11)"` - ToUid int `json:"to_uid" xorm:"not null default 0 comment('转赠的用户id') INT(11)"` - TransferMoney string `json:"transfer_money" xorm:"not null default '0.000000' comment('转赠已撤回金额') INT(11)"` + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"` + CoinId int `json:"coin_id" xorm:"not null comment('虚拟币id') INT(11)"` + Direction int `json:"direction" xorm:"not null comment('方向:1收入 2支出') TINYINT(255)"` + Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"` + OrdId string `json:"ord_id" xorm:"comment('相关的订单id') VARCHAR(255)"` + Amout string `json:"amout" xorm:"not null comment('变更数量') DECIMAL(16,6)"` + BeforeAmout string `json:"before_amout" xorm:"not null comment('变更前数量') DECIMAL(16,6)"` + AfterAmout string `json:"after_amout" xorm:"not null comment('变更后数量') DECIMAL(16,6)"` + SysFee string `json:"sys_fee" xorm:"not null default 0.000000 comment('手续费') DECIMAL(16,6)"` + CreateTime time.Time `json:"create_time" xorm:"created default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + TransferType int `json:"transfer_type" xorm:"comment('转账类型:1全球分红,2管理员修改,3消费,4退回,5虚拟币兑换') TINYINT(100)"` + CoinIdTo int `json:"coin_id_to" xorm:"not null default 0 comment('兑换时目标币种id') INT(11)"` + IsRevoke int `json:"is_revoke" xorm:"not null default 0 comment('转赠是否撤回') INT(1)"` + TransferId int `json:"transfer_id" xorm:"not null default 0 comment('转赠关联id') INT(11)"` + ToUid int `json:"to_uid" xorm:"not null default 0 comment('转赠的用户id') INT(11)"` + TransferMoney string `json:"transfer_money" xorm:"not null default '0.000000' comment('转赠已撤回金额') INT(11)"` } From a762c9a581719e608edd76f961725409ace9d649 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 10 Dec 2023 23:40:09 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/model/user_virtual_coin_flow.go | 35 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/db/model/user_virtual_coin_flow.go b/db/model/user_virtual_coin_flow.go index bdcc2f0..370db00 100644 --- a/db/model/user_virtual_coin_flow.go +++ b/db/model/user_virtual_coin_flow.go @@ -5,21 +5,22 @@ import ( ) type UserVirtualCoinFlow struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` - Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"` - CoinId int `json:"coin_id" xorm:"not null comment('虚拟币id') INT(11)"` - Direction int `json:"direction" xorm:"not null comment('方向:1收入 2支出') TINYINT(255)"` - Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"` - OrdId string `json:"ord_id" xorm:"comment('相关的订单id') VARCHAR(255)"` - Amout string `json:"amout" xorm:"not null comment('变更数量') DECIMAL(16,6)"` - BeforeAmout string `json:"before_amout" xorm:"not null comment('变更前数量') DECIMAL(16,6)"` - AfterAmout string `json:"after_amout" xorm:"not null comment('变更后数量') DECIMAL(16,6)"` - SysFee string `json:"sys_fee" xorm:"not null default 0.000000 comment('手续费') DECIMAL(16,6)"` - CreateTime time.Time `json:"create_time" xorm:"created default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` - TransferType int `json:"transfer_type" xorm:"comment('转账类型:1全球分红,2管理员修改,3消费,4退回,5虚拟币兑换') TINYINT(100)"` - CoinIdTo int `json:"coin_id_to" xorm:"not null default 0 comment('兑换时目标币种id') INT(11)"` - IsRevoke int `json:"is_revoke" xorm:"not null default 0 comment('转赠是否撤回') INT(1)"` - TransferId int `json:"transfer_id" xorm:"not null default 0 comment('转赠关联id') INT(11)"` - ToUid int `json:"to_uid" xorm:"not null default 0 comment('转赠的用户id') INT(11)"` - TransferMoney string `json:"transfer_money" xorm:"not null default '0.000000' comment('转赠已撤回金额') INT(11)"` + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"` + CoinId int `json:"coin_id" xorm:"not null comment('虚拟币id') INT(11)"` + Direction int `json:"direction" xorm:"not null comment('方向:1收入 2支出') TINYINT(255)"` + Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"` + OrdId string `json:"ord_id" xorm:"comment('相关的订单id') VARCHAR(255)"` + Amout string `json:"amout" xorm:"not null comment('变更数量') DECIMAL(16,6)"` + BeforeAmout string `json:"before_amout" xorm:"not null comment('变更前数量') DECIMAL(16,6)"` + AfterAmout string `json:"after_amout" xorm:"not null comment('变更后数量') DECIMAL(16,6)"` + SysFee string `json:"sys_fee" xorm:"not null default 0.000000 comment('手续费') DECIMAL(16,6)"` + CoinTransferData string `json:"coin_transfer_data" xorm:"not null comment('虚拟币转赠信息') TEXT"` + CreateTime time.Time `json:"create_time" xorm:"created default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + TransferType int `json:"transfer_type" xorm:"comment('转账类型:1全球分红,2管理员修改,3消费,4退回,5虚拟币兑换') TINYINT(100)"` + CoinIdTo int `json:"coin_id_to" xorm:"not null default 0 comment('兑换时目标币种id') INT(11)"` + IsRevoke int `json:"is_revoke" xorm:"not null default 0 comment('转赠是否撤回') INT(1)"` + TransferId int `json:"transfer_id" xorm:"not null default 0 comment('转赠关联id') INT(11)"` + ToUid int `json:"to_uid" xorm:"not null default 0 comment('转赠的用户id') INT(11)"` + TransferMoney string `json:"transfer_money" xorm:"not null default '0.000000' comment('转赠已撤回金额') INT(11)"` } From 0b46ea50e3fb86d89aafe604cce3ccc2b87c9635 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 13 Dec 2023 10:26:10 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/model/plan_reward.go | 1 + svc/get_plan_cfg.go | 1 + 2 files changed, 2 insertions(+) diff --git a/db/model/plan_reward.go b/db/model/plan_reward.go index 6d0cb5f..01bafc1 100644 --- a/db/model/plan_reward.go +++ b/db/model/plan_reward.go @@ -9,6 +9,7 @@ type PlanReward struct { RegionSubRate float32 `json:"region_sub_rate" xorm:"not null default 0.0000 comment('区域代理抽成比例') FLOAT(6,4)"` GlobalRate float32 `json:"global_rate" xorm:"not null default 0.0000 comment('全球分红抽成比例') FLOAT(6,4)"` SelfBuyGlobalRate float64 `json:"self_buy_global_rate" xorm:"not null default 0.0000 comment('全球分红抽成比例') FLOAT(6,4)"` + BuckleRate float64 `json:"buckle_rate_rate" xorm:"not null default 0.0000 comment('抽成比例') FLOAT(6,4)"` SettleMode int `json:"settle_mode" xorm:"not null default 1 comment('0.手动方案,1.自动方案') TINYINT(1)"` PlanCommissionId int `json:"plan_commission_id" xorm:"not null default 0 comment('佣金方案0未设置,>0对应方案') TINYINT(3)"` PlanSettleId int `json:"plan_settle_id" xorm:"not null default 0 comment('结算方案0未设置,>0对应方案') TINYINT(3)"` diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index e838aa9..c9dbe76 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -33,6 +33,7 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m plan := make(map[string]*model.PlanReward, 0) pvds, _ := db.DbsPlanRewardByPvds(eg) for _, v := range pvds { + v.BuckleRate = v.BuckleRate / 100 plan[v.Pvd] = v } list, _ := db.SecondGetAllPriceTypeList(eg) From 651e38459531c791551a5894a703f4e4ced5374a Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 13 Dec 2023 10:29:05 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/comm_plan/init.go | 1 + svc/get_plan_cfg.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/comm_plan/init.go b/lib/comm_plan/init.go index ac61a7d..5599b26 100644 --- a/lib/comm_plan/init.go +++ b/lib/comm_plan/init.go @@ -21,6 +21,7 @@ type NiuBeiIntegralReleaseO2oRatio struct { Key string `json:"key"` } type PlanOpt struct { + BuckleRate float64 PointType int IntegralOpen int PlanCommissionId int diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index c9dbe76..50abfb8 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -33,7 +33,6 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m plan := make(map[string]*model.PlanReward, 0) pvds, _ := db.DbsPlanRewardByPvds(eg) for _, v := range pvds { - v.BuckleRate = v.BuckleRate / 100 plan[v.Pvd] = v } list, _ := db.SecondGetAllPriceTypeList(eg) @@ -290,6 +289,7 @@ func PlanOpts(eg *xorm.Engine) map[string]*comm_plan.PlanOpt { GlobalRate: float64(v.GlobalRate), SelfBuyGlobalRate: v.SelfBuyGlobalRate, UserRate: subsidyTmp, + BuckleRate: v.BuckleRate, } } From 6f5ba418f36cfab7e2a962227cd2f5fa0e84904e Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 13 Dec 2023 16:54:13 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/get_plan_cfg.go | 1 + 1 file changed, 1 insertion(+) diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 50abfb8..e674712 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -116,6 +116,7 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo opt.MerchantRate = float64(int64(rewardOpt.MerchantRate*1e4)) / 1e4 opt.NewAgentRate = float64(int64(rewardOpt.NewAgentRate*1e4)) / 1e4 opt.OrderBeforeRate = float64(int64(rewardOpt.OrderBeforeRate*1e4)) / 1e4 + opt.BuckleRate = float64(int64(rewardOpt.BuckleRate*1e4)) / 1e4 opt.PlanCommissionId = rewardOpt.PlanCommissionId rateList := make(map[string]float64) if rewardOpt.RateList != "" { From 48cbac494a32587813c6b46d6009b87df8758aee Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 16 Dec 2023 11:34:09 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/small_public_platoon_relate_commission.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/svc/small_public_platoon_relate_commission.go b/svc/small_public_platoon_relate_commission.go index 95a3dfa..4cede8c 100644 --- a/svc/small_public_platoon_relate_commission.go +++ b/svc/small_public_platoon_relate_commission.go @@ -54,9 +54,13 @@ func BatchSmallGetPublicPlatoonRelateCommission(engine *xorm.Engine, masterId st var commonWealthSystem = make(map[string]string) if lvGrade != nil { for _, coinId := range lvGrade.ReturnType { - selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) - commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) - directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) + var pendingAmount = param.PendingAmount + if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 + pendingAmount = param.PendingIntegral + } + selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) + commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) + directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) } }