huangjiajun 3 weeks ago
parent
commit
2c4d07fba7
6 changed files with 33 additions and 9 deletions
  1. +5
    -1
      lib/comm_plan/all.go
  2. +5
    -1
      lib/comm_plan/ds_check.go
  3. +6
    -2
      lib/comm_plan/other.go
  4. +5
    -1
      lib/comm_plan/self.go
  5. +6
    -2
      lib/comm_plan/winery.go
  6. +6
    -2
      svc/svc_integral_release.go

+ 5
- 1
lib/comm_plan/all.go View File

@@ -132,7 +132,11 @@ func CalcAll(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUser,
ratioListMap := convertList2Map(ratioList)

for k, v := range userList.ProfitList {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
if v.Cid == "0" {
userList.ProfitList[k].Val = v.Val
} else {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
}
}
// 各种币换算出总的额度
totalAmtList := make([]*VirtualCoinCommission, 0)


+ 5
- 1
lib/comm_plan/ds_check.go View File

@@ -219,7 +219,11 @@ func CalcDsCheck(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvU
ratioListMap := convertList2Map(ratioList)

for k, v := range userList.ProfitList {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
if v.Cid == "0" {
userList.ProfitList[k].Val = v.Val
} else {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
}
}
userList.MinProfit = 0
userList.MinProfitList = make([]*VirtualCoinCommission, 0)


+ 6
- 2
lib/comm_plan/other.go View File

@@ -22,7 +22,11 @@ func CalcOther(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUse
ratioListMap := convertList2Map(ratioList)

for k, v := range userList.ProfitList {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
if v.Cid == "0" {
userList.ProfitList[k].Val = v.Val
} else {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
}
}
// 各种币换算出总的额度
totalAmtList := make([]*VirtualCoinCommission, 0)
@@ -128,7 +132,7 @@ Loop:
return nil
}

//公共处理同级计算 (只计算佣金 旧版本用)
// 公共处理同级计算 (只计算佣金 旧版本用)
func otherSameMoney(lv, isOnlySubsidy int, restAmt, profit, peerRate, totalRatio, restRatio, subsidyFee, subsidyBili float64, opt *PlanOpt) (float64, float64, float64, float64, float64, bool) {
//如果不够扣了,并且是比例返利就跳过
if restAmt < profit {


+ 5
- 1
lib/comm_plan/self.go View File

@@ -22,7 +22,11 @@ func CalcSelf(opt *PlanOpt, totalAmt float64, integralTotalAmt float64, userList
ratioListMap := convertList2Map(ratioList)

for k, v := range userList.ProfitList {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
if v.Cid == "0" {
userList.ProfitList[k].Val = v.Val
} else {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
}
}
// 各种币换算出总的额度
totalAmtList := make([]*VirtualCoinCommission, 0)


+ 6
- 2
lib/comm_plan/winery.go View File

@@ -23,7 +23,11 @@ func CalcWinery(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUs
userList.SubsidyFee = 0
ratioListMap := convertList2Map(ratioList)
for k, v := range userList.ProfitList {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
if v.Cid == "0" {
userList.ProfitList[k].Val = v.Val
} else {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
}
}
maxLvData, _ := db.UserLevelByID(eg, "2")
// 各种币换算出总的额度
@@ -718,7 +722,7 @@ func CalReturnAmountAndRatioExtendWinery(level, ownbuyReturnType, peerNum int, u
return commission, commissionRatio, amountList, ratioList
}

//公共处理下团队-上一层 (用于旧版的制度 只有佣金时)
// 公共处理下团队-上一层 (用于旧版的制度 只有佣金时)
func extendDiffMoney(profit float64, payMode, isOnlySubsidy int, totalAmt, restAmt, teamRatio, totalRatio, peerRate, subsidyFee, subsidyRatio float64) (float64, float64, float64, float64, bool) {
//totalRatio += teamRatio
//出现负数跳过


+ 6
- 2
svc/svc_integral_release.go View File

@@ -117,7 +117,11 @@ func CalIntegralRelease(subsidyTmp map[string]*md.IntegralReleaseLvGrade, totalA
userList.ProfitList = amountList // 各币种分佣
ratioListMap := convertList2Map(ratioList)
for k, v := range userList.ProfitList {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
if v.Cid == "0" {
userList.ProfitList[k].Val = v.Val
} else {
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val
}
}
// 各种币换算出总的额度
totalAmtList := make([]*comm_plan.VirtualCoinCommission, 0)
@@ -174,7 +178,7 @@ func CalIntegralRelease(subsidyTmp map[string]*md.IntegralReleaseLvGrade, totalA
return nil
}

//佣金 积分 区块币计算
// 佣金 积分 区块币计算
func CalReturnAmountAndRatio(level, ownbuyReturnType int, userType string, fee, integralFee, integralFeeCom float64, subsidyTmp map[string]*md.IntegralReleaseLvGrade, commArr map[string]string, virtualCoinMoneyRatio map[int]string) (commission, commissionRatio float64, amountList, ratioList []*comm_plan.VirtualCoinCommission) {
lvGrade := subsidyTmp[zhios_order_relate_utils.IntToStr(level)]
if lvGrade == nil {


Loading…
Cancel
Save