huangjiajun pirms 1 gada
vecāks
revīzija
e77c301a7b
4 mainītis faili ar 18 papildinājumiem un 3 dzēšanām
  1. +1
    -0
      db/model/plan_reward.go
  2. +1
    -0
      lib/comm_plan/init.go
  3. +9
    -0
      svc/get_plan_cfg.go
  4. +7
    -3
      svc/reward_commission.go

+ 1
- 0
db/model/plan_reward.go Parādīt failu

@@ -22,4 +22,5 @@ type PlanReward struct {
OrderBeforeRate float32 `json:"order_before_rate" xorm:"not null default 0.0000 comment('下单前的联盟抽成') FLOAT(6,4)"`
IntegralOpen int `json:"integral_open" xorm:"not null default 0 comment('积分抽成') TINYINT(1)"`
PointType int `json:"point_type" xorm:"not null default 0 comment('') TINYINT(1)"`
RateList string `json:"rate_list" xorm:"not null default '' comment('') VARCHAR(3000)"`
}

+ 1
- 0
lib/comm_plan/init.go Parādīt failu

@@ -38,6 +38,7 @@ type PlanOpt struct {
MerchantRate float64 //商家占佣比例
NewAgentRate float64 //代理分红占佣比例
OrderBeforeRate float64
RateList map[string]float64
PushHandRate float64 //推手占佣比例
//IntegralBili float64 // 积分兑换比例
//BlockIconsBili float64 // 区块币兑换比例


+ 9
- 0
svc/get_plan_cfg.go Parādīt failu

@@ -81,6 +81,15 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo
opt.NewAgentRate = float64(int64(rewardOpt.NewAgentRate*1e4)) / 1e4
opt.OrderBeforeRate = float64(int64(rewardOpt.OrderBeforeRate*1e4)) / 1e4
opt.PlanCommissionId = rewardOpt.PlanCommissionId
rateList := make(map[string]float64)
if rewardOpt.RateList != "" {
rateListMap := make(map[string]interface{})
json.Unmarshal([]byte(rewardOpt.RateList), &rateListMap)
for k1, v1 := range rateListMap {
rateList[k1] = zhios_order_relate_utils.AnyToFloat64(v1)
}
}
opt.RateList = rateList
// 兑换现金比例
if virtualCoinMoneyRate == nil {
opt.VirtualCoinMoneyRatioList = nil


+ 7
- 3
svc/reward_commission.go Parādīt failu

@@ -508,12 +508,13 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6

// 剩余可分配的佣金
total := int64(fee*1e4) - int64(pvdFee*1e4) - int64(sysFee*1e4) - int64(regionFee*1e4) - int64(regionSubFee*1e4) - int64(globalFee*1e4) - int64(selfBuyGlobalFee*1e4) - int64(pushHandFee*1e4) - int64(merchantFee*1e4) - int64(newAgentFee*1e4)

for _, v := range opt.RateList {
total -= int64(fee * v * 1e4)
}
fee = float64(total) / 1e4
if fee < 0 {
fee = 0
}

pvdFeeFirst := feeFirst * opt.PvdRate // 供应商联盟比例
sysFeeFirst := feeFirst * opt.SysRate // 平台比例
regionFeeFirst := feeFirst * opt.RegionRate // 区域代理比例
@@ -526,7 +527,9 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6

// 剩余可分配的佣金
totalFirst := int64(feeFirst*1e4) - int64(pvdFeeFirst*1e4) - int64(sysFeeFirst*1e4) - int64(regionFeeFirst*1e4) - int64(regionSubFeeFirst*1e4) - int64(globalFeeFirst*1e4) - int64(selfBuyGlobalFeeFirst*1e4) - int64(pushHandFeeFirst*1e4) - int64(merchantFeeFirst*1e4) - int64(newAgentFeeFirst*1e4)

for _, v := range opt.RateList {
totalFirst -= int64(feeFirst * v * 1e4)
}
feeFirst = float64(totalFirst) / 1e4
if feeFirst < 0 {
feeFirst = 0
@@ -856,6 +859,7 @@ func BatchGetPublicPlatoonRelateCommissionByGoods(engine *xorm.Engine, masterId
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100)
}
}

resp[param.Oid] = &md.PublicPlatoonRelateCommissionResp{
Uid: param.Uid,
PendingAmount: param.PendingAmount,


Notiek ielāde…
Atcelt
Saglabāt