huangjiajun 1 год назад
Родитель
Сommit
4fd7bcf9f4
5 измененных файлов: 24 добавлений и 13 удалений
  1. +6
    -2
      lib/comm_plan/all.go
  2. +4
    -1
      lib/comm_plan/ds_check.go
  3. +2
    -2
      lib/comm_plan/init.go
  4. +7
    -7
      svc/get_plan_cfg.go
  5. +5
    -1
      svc/reward_commission.go

+ 6
- 2
lib/comm_plan/all.go Просмотреть файл

@@ -748,8 +748,12 @@ func getVirtualCoinRatio(typ string, level, peerNum int, grade map[int]*LvGrade,
switch typ {
case "extend_lv":
if isPostion == 1 {
ratio, ok = grade[level].SecondExtendList[coinId]
ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)
SecondExtendList, ok1 := grade[level].SecondExtendList.(map[string]string)
if ok1 {
ratio, ok = SecondExtendList[coinId]
ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)

}
} else {
ratio, ok = grade[level].NewExtendList[coinId]
ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)


+ 4
- 1
lib/comm_plan/ds_check.go Просмотреть файл

@@ -70,7 +70,10 @@ func getVirtualCoinRatioDsOwn(typ string, level, peerNum int, grade map[int]*LvG
switch typ {
case "extend_lv":
if isPostion == 1 {
ratio, ok = grade[level].SecondExtendList[coinId]
SecondExtendList, ok1 := grade[level].SecondExtendList.(map[string]string)
if ok1 {
ratio, ok = SecondExtendList[coinId]
}
} else {
ratio, ok = grade[level].NewExtendList[coinId]
}


+ 2
- 2
lib/comm_plan/init.go Просмотреть файл

@@ -72,7 +72,7 @@ type LvGrade struct {
TeamRateList map[string]string `json:"team_rate_list"` // 团队最高比例
NewTeamList map[string]string `json:"new_team_list"` // 新团队比例
NewExtendList map[string]string `json:"new_extend_list"` // 直推比例
SecondExtendList map[string]string `json:"second_extend_list"` // 直推比例
SecondExtendList interface{} `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"`
@@ -85,7 +85,7 @@ type LvGrade struct {
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"` //
CommonWealthSystem map[string]string `json:"common_wealth_system"` //共富制度比例
CommonWealthSystem interface{} `json:"common_wealth_system"` //共富制度比例

}
type LvGradePricePublic struct {


+ 7
- 7
svc/get_plan_cfg.go Просмотреть файл

@@ -141,13 +141,13 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo
var subsidyTmpPricePublic map[int]*comm_plan.LvGradePricePublic
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\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"new_team_list\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"new_extend_list\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"second_extend_list\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"to_extend_list\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"common_wealth_system\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"common_wealth_system\":[\"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, ",\"common_wealth_system\":[]", "\"common_wealth_system\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"common_wealth_system\":[\"0\"]", "\"common_wealth_system\":{}")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, ",\"to_team_list\":[]", "")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"same_extend\":[[]]", "\"same_extend\":[]")
if strings.Contains(commissionOpt.Data, "\"subsidy_mode_list\":[") { //兼容旧的方案


+ 5
- 1
svc/reward_commission.go Просмотреть файл

@@ -320,7 +320,11 @@ func public(engine *xorm.Engine, ulinkParent *comm_plan.LvUser, cfg *comm_plan.P
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数
pendingAmount = zhios_order_relate_utils.Float64ToStr(integralFee)
}
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(grade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100)
CommonWealthSystems, ok := grade.CommonWealthSystem.(map[string]string)
if ok {
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(CommonWealthSystems[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100)

}
}
}
//共富收益处理


Загрузка…
Отмена
Сохранить