|
|
@@ -90,9 +90,9 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b |
|
|
|
if cfg.Mode == "public_platoon" { |
|
|
|
//公排 |
|
|
|
//佣金扣除抽成后 |
|
|
|
fee, _, pvdFee, sysFee := CommFee(comf, cfg, "commission", rmd.IsGoods) |
|
|
|
fee, _, pvdFee, sysFee := CommFee(comf, cfg, "commission", rmd) |
|
|
|
////积分扣除抽成后 |
|
|
|
integralFee, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(price), cfg, "integral", rmd.IsGoods) |
|
|
|
integralFee, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(price), cfg, "integral", rmd) |
|
|
|
//调用公排制度 |
|
|
|
|
|
|
|
userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
@@ -175,7 +175,7 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b |
|
|
|
} |
|
|
|
if cfg.Mode == "lv_integral_release" { // |
|
|
|
price = rmd.OldPrice |
|
|
|
pvdFee, sysFee, _, ulink, err := IntegralRelease(engine, uid, newLevel, returnAllLevel, rmd.IsShowExtend, newProvider, user, comf, price, cfg, rmd.IsGoods, commArr, virtualCoinMoneyRate) |
|
|
|
pvdFee, sysFee, _, ulink, err := IntegralRelease(engine, uid, newLevel, returnAllLevel, rmd.IsShowExtend, newProvider, user, comf, price, cfg, rmd, commArr, virtualCoinMoneyRate) |
|
|
|
if err != nil { |
|
|
|
return 0, 0, 0, 0, nil, nil |
|
|
|
} |
|
|
@@ -195,9 +195,9 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b |
|
|
|
userLevel = zhios_order_relate_utils.StrToInt(extraData["agent_lv"]) |
|
|
|
} |
|
|
|
//佣金扣除抽成后 |
|
|
|
fee, _, pvdFee, sysFee := CommFee(comf, cfg, "commission", rmd.IsGoods) |
|
|
|
fee, _, pvdFee, sysFee := CommFee(comf, cfg, "commission", rmd) |
|
|
|
////积分扣除抽成后 |
|
|
|
integralFee, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(price), cfg, "integral", rmd.IsGoods) |
|
|
|
integralFee, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(price), cfg, "integral", rmd) |
|
|
|
var param = map[string]string{ |
|
|
|
"commission": zhios_order_relate_utils.Float64ToStr(fee), |
|
|
|
"integral": zhios_order_relate_utils.Float64ToStr(integralFee), |
|
|
@@ -270,9 +270,9 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b |
|
|
|
} |
|
|
|
func public(engine *xorm.Engine, ulinkParent *comm_plan.LvUser, cfg *comm_plan.PlanOpt, newProvider string, uid int, comf float64, price string, rmd *md.CommissionParam) *comm_plan.LvUser { |
|
|
|
//佣金扣除抽成后 |
|
|
|
fee, _, _, _ := CommFee(comf, cfg, "commission", rmd.IsGoods) |
|
|
|
fee, _, _, _ := CommFee(comf, cfg, "commission", rmd) |
|
|
|
////积分扣除抽成后 |
|
|
|
integralFee, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(price), cfg, "integral", rmd.IsGoods) |
|
|
|
integralFee, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(price), cfg, "integral", rmd) |
|
|
|
//调用公排制度 |
|
|
|
|
|
|
|
userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
@@ -576,12 +576,12 @@ func currentPrice(m *md.CommissionParam, pvd string) string { |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float64, float64, float64, float64) { |
|
|
|
func CommFee(fee float64, opt *comm_plan.PlanOpt, types string, rmd *md.CommissionParam) (float64, float64, float64, float64) { |
|
|
|
var feeFirst float64 = 1 |
|
|
|
if types == "integral" && opt.IntegralOpen == 0 || opt.Mode == "lv_winery" { //积分抽成后台没开启不用扣 |
|
|
|
return fee, feeFirst, 0, 0 |
|
|
|
} |
|
|
|
|
|
|
|
isGoods := rmd.IsGoods |
|
|
|
if isGoods == "1" { |
|
|
|
orderBeforeRate := fee * opt.OrderBeforeRate |
|
|
|
orderBeforeRateFirst := feeFirst * opt.OrderBeforeRate |
|
|
@@ -610,6 +610,9 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6 |
|
|
|
for _, v := range opt.RateList { |
|
|
|
total -= int64(fee * (v / 100) * 1e4) |
|
|
|
} |
|
|
|
if zhios_order_relate_utils.StrToFloat64(rmd.DouyinBili) > 0 { |
|
|
|
total -= int64(zhios_order_relate_utils.StrToFloat64(rmd.DouyinBili) * 1e4) |
|
|
|
} |
|
|
|
fee = float64(total) / 1e4 |
|
|
|
if fee < 0 { |
|
|
|
fee = 0 |
|
|
@@ -645,10 +648,10 @@ func CalcCommission(uid, level, oldDiff, ownbuyReturnType int, fee, integralFee |
|
|
|
//佣金扣除抽成后 |
|
|
|
var feeFirst float64 = 1 |
|
|
|
var integralFeeFirst float64 = 1 |
|
|
|
fee, feeFirst, pvdFee, sysFee = CommFee(fee, opt, "commission", isGoods) |
|
|
|
fee, feeFirst, pvdFee, sysFee = CommFee(fee, opt, "commission", rmd) |
|
|
|
//积分扣除抽成后 |
|
|
|
var integralSysFee float64 = 0 |
|
|
|
integralFee, integralFeeFirst, _, integralSysFee = CommFee(integralFee, opt, "integral", isGoods) |
|
|
|
integralFee, integralFeeFirst, _, integralSysFee = CommFee(integralFee, opt, "integral", rmd) |
|
|
|
// 计算自购补贴比例 |
|
|
|
subsidyFee = 0 |
|
|
|
//如果没登录,要找出权重最低的那个 |
|
|
@@ -764,11 +767,11 @@ func CalcCommission(uid, level, oldDiff, ownbuyReturnType int, fee, integralFee |
|
|
|
//pvd 只是为了判断是会员升级的订单 可不传 |
|
|
|
func NiuBeiCalcCommission(uid, level, oldDiff, ownbuyReturnType int, fee, integralFee float64, isShare bool, opt *comm_plan.PlanOpt, userRelationShip *[]md.UserRelation, pvd string, newLevel int, eg *xorm.Engine, isGoods string, rmd *md.CommissionParam) (pvdFee, sysFee, subsidyFee float64, lvUser *comm_plan.LvUser, err error) { |
|
|
|
//佣金扣除抽成后 |
|
|
|
fee, _, pvdFee, sysFee = CommFee(fee, opt, "commission", isGoods) |
|
|
|
fee, _, pvdFee, sysFee = CommFee(fee, opt, "commission", rmd) |
|
|
|
//积分扣除抽成后 |
|
|
|
var integralSysFee float64 = 0 |
|
|
|
integralFee, _, _, integralSysFee = CommFee(integralFee, opt, "integral", isGoods) |
|
|
|
integralFeeForPrice, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(rmd.OldPrice), opt, "integral", isGoods) |
|
|
|
integralFee, _, _, integralSysFee = CommFee(integralFee, opt, "integral", rmd) |
|
|
|
integralFeeForPrice, _, _, _ := CommFee(zhios_order_relate_utils.StrToFloat64(rmd.OldPrice), opt, "integral", rmd) |
|
|
|
// 计算自购补贴比例 |
|
|
|
subsidyFee = 0 |
|
|
|
//如果没登录,要找出权重最低的那个 |
|
|
|