Browse Source

更新

tags/v4.3.1
huangjiajun 1 year ago
parent
commit
7551002401
4 changed files with 460 additions and 11 deletions
  1. +15
    -0
      lib/comm_plan/init.go
  2. +420
    -0
      lib/comm_plan/winery_adv.go
  3. +16
    -0
      svc/get_plan_cfg.go
  4. +9
    -11
      svc/reward_commission.go

+ 15
- 0
lib/comm_plan/init.go View File

@@ -10,6 +10,7 @@ var Fn = map[string]func(opt *PlanOpt, totalAmt, integralTotalAmt float64, userL
"lv_subsidy": CalcAll,
"lv_price": CalcAll,
"lv_winery": CalcWinery,
"lv_winery_adv": CalcAdv,
"lv_price_other": CalcOther,
"lv_ds_check": CalcDsCheck,
}
@@ -67,6 +68,7 @@ type LvGrade struct {
NewTeamList map[string]string `json:"new_team_list"` // 新团队比例
NewExtendList map[string]string `json:"new_extend_list"` // 直推比例
SecondExtendList map[string]string `json:"second_extend_list"` // 直推比例
ToTeamList map[string]string `json:"to_team_list"` // 直推比例
SameUserCount string `json:"same_user_count"`
SameExtend []map[string]string `json:"same_extend"`
SubsidyModeList map[string]interface{} `json:"subsidy_mode_list"` // 各币种返佣模式:bili:比例 money:固定金额
@@ -77,6 +79,16 @@ type LvGrade struct {
SubsidyOwnBiliList []map[string]string `json:"subsidy_own_bili_list"`
TikTokTeamSubsidyOwnBiliType []string `json:"tik_tok_team_subsidy_own_bili_type"` //分销 返利类型
TikTokTeamSubsidyList []map[string]string `json:"tik_tok_team_subsidy_list"`
ToExtendList map[string]string `json:"to_extend_list"` //

}
type LvGradeWineryAdv struct {
Lv int `json:"lv"` // 级别
PayMode int `json:"pay_mode"` // 0团队内部支出, 1平台系统支出
PeerRateList []map[string]string `json:"peer_rate_list"` //同级比例
ReturnType []string `json:"return_type"` //返利类型
ToExtendList map[string]string `json:"to_extend_list"` //
ToTeamList map[string]string `json:"to_team_list"` // 直推比例
}
type LvGradeDs struct {
Lv int `json:"lv"` // 级别
@@ -185,6 +197,9 @@ type LvUser struct {
Diff int // 与当前用户级别差
OldDiff int // 旧的与当前用户级别差
ParentUser *LvUser // 父用户
LastProfit float64
LastProfitList []*VirtualCoinCommission // 各币种对用的数量

}

// 虚拟币分佣结构体


+ 420
- 0
lib/comm_plan/winery_adv.go View File

@@ -0,0 +1,420 @@
package comm_plan

import (
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx"
"fmt"
"xorm.io/xorm"
)

func CalReturnAmountAndRatioWineryAdv(level, ownbuyReturnType, peerNum int, userType string, fee, integralFee float64, opt *PlanOpt) (commission, commissionRatio float64, amountList, ratioList []*VirtualCoinCommission) {
var maxReturnTypeCount = 0
var returnType = make([]string, 0)
for _, v := range opt.UserRate {
if v.ReturnType != nil {
if len(v.ReturnType) > maxReturnTypeCount {
maxReturnTypeCount = len(v.ReturnType)
returnType = v.ReturnType
}
}
}
// 新版支持多种虚拟币 支持的种类id保存在ReturnType id=0代表现金佣金 其他为虚拟币
if returnType != nil { //返佣类型
for _, coinId := range returnType {
newFee := integralFee
if coinId == "0" {
newFee = fee
}
ratio := getVirtualCoinRatioWineryAdv(userType, level, peerNum, opt.UserRate, coinId, 0)
amount := getCoinAmount(ratio, zhios_order_relate_utils.StrToInt(coinId), newFee, opt.VirtualCoinMoneyRatioList)
if userType == "own" { //酒庄模式不在这里计算
amount = 0
commission = 0
}
if coinId == "0" {
commission = amount
commissionRatio = zhios_order_relate_utils.StrToFloat64(ratio)
}
amountList = append(amountList, &VirtualCoinCommission{
Cid: coinId,
Val: amount,
ProfitBili: zhios_order_relate_utils.AnyToFloat64(ratio),
})
ratioList = append(ratioList, &VirtualCoinCommission{
Cid: coinId,
Val: zhios_order_relate_utils.AnyToFloat64(ratio),
})
}
}

if ownbuyReturnType == 1 { //自购不返利
commission = 0
for i := range amountList {
amountList[i].Val = 0
}
}
commission = zhios_order_relate_utils.FloatFormat(commission, 2)

for i, coin := range amountList {
amountList[i].Val = zhios_order_relate_utils.FloatFormat(coin.Val, 6)
}

return commission, commissionRatio, amountList, ratioList
}
func CalReturnAmountAndRatioWineryAdvTeam(node *LvUser, level, peerNum int, userType string, opt *PlanOpt) (commission, commissionRatio float64, amountList, ratioList []*VirtualCoinCommission) {
var maxReturnTypeCount = 0
var returnType = make([]string, 0)
for _, v := range opt.UserRate {
if v.ReturnType != nil {
if len(v.ReturnType) > maxReturnTypeCount {
maxReturnTypeCount = len(v.ReturnType)
returnType = v.ReturnType
}
}
}
// 新版支持多种虚拟币 支持的种类id保存在ReturnType id=0代表现金佣金 其他为虚拟币
if returnType != nil { //返佣类型
for _, coinId := range returnType {
var newFee float64 = 0
if len(node.LastProfitList) > 0 {
for _, v := range node.LastProfitList {
if v.Cid == coinId {
newFee = v.Val
}
}
}
if coinId == "0" {
newFee = node.LastProfit
}
ratio := getVirtualCoinRatioWineryAdv(userType, level, peerNum, opt.UserRate, coinId, 0)
amount := getCoinAmount(ratio, zhios_order_relate_utils.StrToInt(coinId), newFee, opt.VirtualCoinMoneyRatioList)
if userType == "own" { //酒庄模式不在这里计算
amount = 0
commission = 0
}
if coinId == "0" {
commission = amount
commissionRatio = zhios_order_relate_utils.StrToFloat64(ratio)
}
amountList = append(amountList, &VirtualCoinCommission{
Cid: coinId,
Val: amount,
ProfitBili: zhios_order_relate_utils.AnyToFloat64(ratio),
})
ratioList = append(ratioList, &VirtualCoinCommission{
Cid: coinId,
Val: zhios_order_relate_utils.AnyToFloat64(ratio),
})
}
}
commission = zhios_order_relate_utils.FloatFormat(commission, 2)
for i, coin := range amountList {
amountList[i].Val = zhios_order_relate_utils.FloatFormat(coin.Val, 6)
}

return commission, commissionRatio, amountList, ratioList
}

// 按总佣金的比例进行划分计算
func CalcAdv(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUser, pvd string, sysFee float64, integralSysFee float64, level, levelWeight int, eg *xorm.Engine) error {
grade := opt.UserRate
if len(grade) == 0 {
return zhios_order_relate_logx.Warn("level grade is not set")
}
userList.Profit = 0
userList.ProfitList = make([]*VirtualCoinCommission, 0) // 各币种分佣
userList.SubsidyFee = 0

userList.LastProfit = totalAmt
userList.LastProfitList = make([]*VirtualCoinCommission, 0)
var maxReturnTypeCount = 0
var returnType = make([]string, 0)
for _, v := range opt.UserRate {
if v.ReturnType != nil {
if len(v.ReturnType) > maxReturnTypeCount {
maxReturnTypeCount = len(v.ReturnType)
returnType = v.ReturnType
}
}
}
// 新版支持多种虚拟币 支持的种类id保存在ReturnType id=0代表现金佣金 其他为虚拟币
if returnType != nil { //返佣类型
for _, coinId := range returnType {
newFee := integralTotalAmt
if coinId == "0" {
newFee = totalAmt
}
if coinId == "0" {
continue
}
userList.LastProfitList = append(userList.LastProfitList, &VirtualCoinCommission{
Cid: coinId,
Val: newFee,
})
}
}
var (
node = userList
maxLv = node.Lv // 当前等级
maxLevelWeight = node.LevelWeight // 当前权重
peerNum = 0 // 存在同级数

)

Loop:
for node.ParentUser != nil { //查找上级用户
node.ParentUser.Profit = 0
count := len(grade[maxLv].PeerRate)
if grade[maxLv].PeerRateList != nil {
count = len(grade[maxLv].PeerRateList)
}
var isBreak bool
zeroList := make(map[string]struct{})
if node.ParentUser.Diff == 1 {
userType := "to_extend"
commission, _, amountList, _ := CalReturnAmountAndRatioWineryAdv(node.ParentUser.Lv, userList.OwnbuyReturnType, peerNum, userType, totalAmt, integralTotalAmt, opt)
node.ParentUser.Profit = commission
node.ParentUser.ProfitList = amountList
// 没得分了 就结束
if isBreak && len(zeroList) == len(opt.UserRate[maxLv].ReturnType) {
break Loop
}
node.ParentUser.LastProfitList = node.ParentUser.ProfitList
node.ParentUser.LastProfit = node.ParentUser.Profit
// 等级往上升则置0
maxLevelWeight, maxLv, peerNum = node.ParentUser.LevelWeight, node.ParentUser.Lv, 0
} else {
// 同级奖
if node.ParentUser.LevelWeight == maxLevelWeight && count > peerNum {
//同级奖励比例
commission, _, amountList, _ := CalReturnAmountAndRatioWineryAdvTeam(node, maxLv, peerNum, "same_lv", opt)
node.ParentUser.Profit = commission
node.ParentUser.ProfitList = amountList
if peerNum+1 == count {
node.ParentUser.LastProfitList = node.LastProfitList
node.ParentUser.LastProfit = node.LastProfit
} else {
node.ParentUser.LastProfitList = node.ParentUser.ProfitList
node.ParentUser.LastProfit = node.ParentUser.Profit
}
peerNum++
} else if node.ParentUser.LevelWeight > maxLevelWeight {
if _, ok := grade[node.Lv]; !ok {
return zhios_order_relate_logx.Warn("level grade node.Lv is not set")
}
if _, ok := grade[node.ParentUser.Lv]; !ok {
return zhios_order_relate_logx.Warn("level grade node.ParentUser.Lv is not set")
}
commission, _, amountList, _ := CalReturnAmountAndRatioWineryAdvTeam(node, node.ParentUser.Lv, peerNum, "to_team", opt)
node.ParentUser.Profit = commission
node.ParentUser.ProfitList = amountList
node.ParentUser.LastProfitList = node.ParentUser.ProfitList
node.ParentUser.LastProfit = node.ParentUser.Profit
// 等级往上升则置0
maxLevelWeight, maxLv, peerNum = node.ParentUser.LevelWeight, node.ParentUser.Lv, 0
}
}
node.Profit = zhios_order_relate_utils.StrToFloat64(fmt.Sprintf("%.4f", node.Profit))
node = node.ParentUser
}

return nil
}

//公共处理同级计算 (只计算佣金 旧版本用)
func sameMoneyWineryAdv(node *LvUser, restAmt, profit, peerRate, totalRatio, restRatio float64, opt *PlanOpt) (float64, float64, float64, float64, bool) {
lv := node.Lv
//如果不够扣了,并且是比例返利就跳过
if restAmt < profit {
return 0, restAmt, totalRatio, peerRate, true
}
if opt == nil {
return 0, restAmt, totalRatio, peerRate, true
}
if opt.UserRate == nil {
return 0, restAmt, totalRatio, peerRate, true
}
if opt.UserRate[lv] == nil {
return 0, restAmt, totalRatio, peerRate, true
}
//极差返利
if opt.UserRate[lv].PayMode == 0 {
restAmt -= profit // 剩余可分
restAmt = zhios_order_relate_utils.FloatFormat(restAmt, 2)
peerRate += restRatio
totalRatio += restRatio
}
return profit, restAmt, totalRatio, peerRate, false
}

func sameMoneyV2WineryAdv(node *LvUser, totalAmtList, restAmtList, profitList, peerRateList, totalRatioList, restRatioList []*VirtualCoinCommission, opt *PlanOpt) ([]*VirtualCoinCommission, []*VirtualCoinCommission, []*VirtualCoinCommission, []*VirtualCoinCommission, map[string]struct{}) {
lv := node.Lv
restAmtMap := convertList2Map(restAmtList)
totalAmtMap := convertList2Map(totalAmtList)
//profitMap := convertList2Map(profitList)
restRatioMap := convertList2Map(restRatioList)
totalRatioMap := convertList2Map(totalRatioList)
peerRateMap := convertList2Map(peerRateList)

zeroList := make(map[string]struct{})

newProfitList := make([]*VirtualCoinCommission, 0)
newRestAmtList := make([]*VirtualCoinCommission, 0)
newTotalRatioList := make([]*VirtualCoinCommission, 0)
newPeerRateList := make([]*VirtualCoinCommission, 0)
if opt == nil {
return newProfitList, newRestAmtList, newTotalRatioList, newPeerRateList, zeroList
}
if opt.UserRate == nil {
return newProfitList, newRestAmtList, newTotalRatioList, newPeerRateList, zeroList
}
if opt.UserRate[lv] == nil {
return newProfitList, newRestAmtList, newTotalRatioList, newPeerRateList, zeroList
}
//极差返利
if opt.UserRate[lv].PayMode == 0 {
for _, coin := range profitList {
profitOne := &VirtualCoinCommission{}
profitOne.Cid = coin.Cid
profitOne.Val = totalAmtMap[coin.Cid] * restRatioMap[coin.Cid]
// 不够扣了 设为0
if restAmtMap[coin.Cid] < profitOne.Val {
profitOne.Val = 0
zeroList[coin.Cid] = struct{}{}
}
// 分佣
newProfitList = append(newProfitList, profitOne)

// 剩余
restAmtMap[coin.Cid] -= profitOne.Val

// 累计比例
totalRatioMap[coin.Cid] += restRatioMap[coin.Cid]

// 同级累计比例
if _, ok := peerRateMap[coin.Cid]; !ok {
peerRateMap[coin.Cid] = 0
}
peerRateMap[coin.Cid] += restRatioMap[coin.Cid]
}
}

newTotalRatioList = convertMap2List(totalRatioMap)
newPeerRateList = convertMap2List(peerRateMap)
newRestAmtList = convertMap2List(restAmtMap)

return newProfitList, newRestAmtList, newTotalRatioList, newPeerRateList, zeroList
}

//公共处理下团队-上一层 (用于旧版的制度 只有佣金时)
func teamDiffMoneyWineryAdv(profit float64, payMode, isOnlySubsidy int, totalAmt, restAmt, teamRatio, totalRatio, peerRate, subsidyFee, subsidyRatio float64) (float64, float64, float64, float64, bool) {
// 如果是团队内部支出团队比例大于同级累计比例 或站长支出
if payMode == 1 || teamRatio > peerRate {
teamRatio = zhios_order_relate_utils.FloatFormat(teamRatio-totalRatio, 6)
}
//极差返利
if isOnlySubsidy == 0 {
totalRatio += teamRatio
//出现负数跳过
if teamRatio <= 0 {
profit = 0
return profit, restAmt, totalRatio, subsidyFee, true
}
profit = zhios_order_relate_utils.FloatFormat(teamRatio*totalAmt, 2)
if restAmt < profit {
profit = 0
return profit, restAmt, totalRatio, subsidyFee, true
}
restAmt -= profit // 剩余可分

} else if isOnlySubsidy == 1 { //如果只返补贴 当成是极差的一部分 所以要扣 不是额外的
totalRatio += zhios_order_relate_utils.FloatFormat(subsidyRatio, 6)
profit = 0
if restAmt < subsidyFee {
profit = 0
subsidyFee = 0
return profit, restAmt, totalRatio, subsidyFee, true
}
restAmt -= subsidyFee // 剩余可分
}
restAmt = zhios_order_relate_utils.FloatFormat(restAmt, 2)
return profit, restAmt, totalRatio, subsidyFee, false
}

// 处理多虚拟币团队的
func teamDiffMoneyV2WineryAdv(profitList []*VirtualCoinCommission, payMode, isOnlySubsidy int, totalAmtList, restAmtList, teamRatioList, totalRatioList, peerRateList, subsidyFeeList, subsidyRatioList []*VirtualCoinCommission) (newProfitList, newRestAmtList, newTotalRatioList, newSubsidyFeeList []*VirtualCoinCommission, zeroList map[string]struct{}) {
restAmtMap := convertList2Map(restAmtList)
totalAmtMap := convertList2Map(totalAmtList)
profitMap := convertList2Map(profitList)
totalRatioMap := convertList2Map(totalRatioList)
peerRateMap := convertList2Map(peerRateList)
subsidyFeeMap := convertList2Map(subsidyFeeList)
subsidyRatioMap := convertList2Map(subsidyRatioList)
teamRatioMap := convertList2Map(teamRatioList)

zeroList = make(map[string]struct{})
newProfitList = make([]*VirtualCoinCommission, 0)

for _, coin := range profitList {
// 如果是团队内部支出团队比例大于同级累计比例 或站长支出
if payMode == 1 || teamRatioMap[coin.Cid] > peerRateMap[coin.Cid] {
teamRatioMap[coin.Cid] = zhios_order_relate_utils.FloatFormat(teamRatioMap[coin.Cid]-totalRatioMap[coin.Cid], 6)
}

if isOnlySubsidy == 0 {
totalRatioMap[coin.Cid] += teamRatioMap[coin.Cid]

profitOne := &VirtualCoinCommission{}
profitOne.Cid = coin.Cid
profitOne.Val = zhios_order_relate_utils.FloatFormat(totalAmtMap[coin.Cid]*teamRatioMap[coin.Cid], 6)
// 剩余不足或比例小于0
if teamRatioMap[coin.Cid] < 0 || restAmtMap[coin.Cid] < profitOne.Val {
zeroList[coin.Cid] = struct{}{}
profitOne.Val = 0
}
newProfitList = append(newProfitList, profitOne)

restAmtMap[coin.Cid] -= profitOne.Val
} else if isOnlySubsidy == 1 { //如果只返补贴 当成是极差的一部分 所以要扣 不是额外的
totalRatioMap[coin.Cid] += zhios_order_relate_utils.FloatFormat(subsidyRatioMap[coin.Cid], 6)
profitMap[coin.Cid] = 0
if restAmtMap[coin.Cid] < subsidyFeeMap[coin.Cid] {
subsidyFeeMap[coin.Cid] = 0
}
restAmtMap[coin.Cid] -= subsidyFeeMap[coin.Cid]
}
}
newTotalRatioList = convertMap2List(totalRatioMap)
newRestAmtList = convertMap2List(restAmtMap)
newSubsidyFeeList = convertMap2List(subsidyFeeMap)

return newProfitList, newRestAmtList, newTotalRatioList, newSubsidyFeeList, zeroList
}

// 获取佣金、虚拟币比例 0=佣金
func getVirtualCoinRatioWineryAdv(typ string, level, peerNum int, grade map[int]*LvGrade, coinId string, isPostion int) (ratio string) {
if grade[level].ReturnType == nil {
return "0"
}
if zhios_order_relate_utils.InArr(coinId, grade[level].ReturnType) == false {
return "0"
}
ok := false
switch typ {
case "same_lv":
ratio, ok = grade[level].PeerRateList[peerNum][coinId]
ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)
case "to_extend":
ratio, ok = grade[level].ToExtendList[coinId]
ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)
case "to_team":
ratio, ok = grade[level].ToTeamList[coinId]
ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)
default:
ratio = "0"
}
if !ok {
ratio = "0"
}
return
}

+ 16
- 0
svc/get_plan_cfg.go View File

@@ -95,11 +95,14 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo

var subsidyTmp map[int]*comm_plan.LvGrade
var subsidyTmpDs map[int]*comm_plan.LvGradeDs
var subsidyTmpWineryAdv map[int]*comm_plan.LvGradeWineryAdv
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"bili\":0", "\"bili\":\"0\"")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"buy_deliver_list\":[]", "\"buy_deliver_list\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"new_team_list\":[]", "\"new_team_list\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"new_extend_list\":[]", "\"new_extend_list\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"second_extend_list\":[]", "\"second_extend_list\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"to_extend_list\":[]", "\"to_extend_list\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"to_team_list\":[]", "\"to_team_list\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"same_extend\":[[]]", "\"same_extend\":[]")
if strings.Contains(commissionOpt.Data, "\"subsidy_mode_list\":[") { //兼容旧的方案
tmp := strings.Split(commissionOpt.Data, "\"subsidy_mode_list\":[")
@@ -141,6 +144,19 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo

return opt, nil
}
if zhios_order_relate_utils.InArr(commissionOpt.Mode, []string{"lv_winery_adv"}) {
if err := json.Unmarshal([]byte(commissionOpt.Data), &subsidyTmpWineryAdv); err != nil {
if masterId == "68823769" {
fmt.Println("===========================分佣方案数据设置错误", commissionOpt)
fmt.Println("===========================分佣方案数据设置错误", err)
}
return nil, zhios_order_relate_logx.Warn(fmt.Sprintf("%s:分佣方案数据设置错误", masterId))
}
copier.Copy(&subsidyTmp, &subsidyTmpDs)
opt.UserRate = subsidyTmp

return opt, nil
}

if err := json.Unmarshal([]byte(commissionOpt.Data), &subsidyTmp); err != nil {
if masterId == "68823769" {


+ 9
- 11
svc/reward_commission.go View File

@@ -545,16 +545,12 @@ func CalcCommission(uid, level, oldDiff, ownbuyReturnType int, fee, integralFee
}
// 抖团服务费金额的补贴
tikTokSubsidyFeeList := getTikTokOwnSubsidy(opt, level, isShare, rmd)
if uid == 8 {
fmt.Println("==================================这里3")
}

// 获取用户的关系网
//userRelationShip, err := UserRelativeNetwork(eg, uid)
// 如果获取用户关系失败或者佣金方案不存在, 那么只计算当前用户的佣金, 平台佣金, 以及供应商方的佣金
if _, ok := comm_plan.Fn[opt.Mode]; !ok || userRelationShip == nil || len(*userRelationShip) == 0 {
if uid == 8 {
fmt.Println("==================================这里4", fee)
}

// 获得自购的
commission, profitBili, amountList, ratioList := comm_plan.CalReturnAmountAndRatio(level, ownbuyReturnType, 0, "own", fee, integralFee, opt)
if opt.Mode == "lv_winery" {
@@ -563,9 +559,13 @@ func CalcCommission(uid, level, oldDiff, ownbuyReturnType int, fee, integralFee
if opt.Mode == "lv_ds_check" {
commission, profitBili, amountList, ratioList = comm_plan.CalReturnAmountAndRatioDsOwn(level, ownbuyReturnType, 0, "own", fee, integralFee, opt)
}
if uid == 8 {
fmt.Println("==================================这里5", commission)
if opt.Mode == "lv_winery_adv" {
commission = 0
amountList = make([]*comm_plan.VirtualCoinCommission, 0)
ratioList = make([]*comm_plan.VirtualCoinCommission, 0)
profitBili = 0
}

ratioListMap := convertList2Map(ratioList)
for k, v := range amountList {
amountList[k].Val = ratioListMap[v.Cid] * v.Val
@@ -573,9 +573,7 @@ func CalcCommission(uid, level, oldDiff, ownbuyReturnType int, fee, integralFee
//重新计算佣金
return pvdFee, sysFee, subsidyFee, &comm_plan.LvUser{ProfitBili: profitBili, FirstFee: feeFirst, IntegralFirstFee: integralFeeFirst, TikTokOwnSubsidyFeeList: tikTokSubsidyFeeList, OwnSubsidyFeeList: subsidyFeeList, Uid: uid, Lv: level, OldDiff: oldDiff, Profit: commission, ProfitList: amountList, Diff: 0}, nil
}
if uid == 8 {
fmt.Println("==================================这里6")
}

//查出所有等级替换权重
levelList, _ := db.UserLevlEgAll(eg)
levelWeight := 0


Loading…
Cancel
Save