|
|
@@ -31,6 +31,7 @@ func BatchGetCommissionByGoods(eg *xorm.Engine, dbName string, commissionParamLi |
|
|
|
if virCfg != nil && virCfg.Val != "" { |
|
|
|
virType = virCfg.Val |
|
|
|
} |
|
|
|
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(eg, dbName) |
|
|
|
for _, param := range commissionParamList { |
|
|
|
param := param // 为下面的闭包创建局部变量 |
|
|
|
group.Go(func() error { |
|
|
@@ -45,9 +46,9 @@ func BatchGetCommissionByGoods(eg *xorm.Engine, dbName string, commissionParamLi |
|
|
|
} |
|
|
|
param.CommissionParam.Oid = param.GoodsId |
|
|
|
param.CommissionParam.IsGoods = "1" |
|
|
|
param.CommissionParam.ShowLevel=param.ShowLevel |
|
|
|
param.CommissionParam.ShowLevel = param.ShowLevel |
|
|
|
|
|
|
|
_, _, _, _, lvUser, err := svc.GetRewardCommission(eg, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType) |
|
|
|
_, _, _, _, lvUser, err := svc.GetRewardCommission(eg, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType, plan, commission, virtualCoinMoneyRate) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
@@ -83,6 +84,8 @@ func BatchGetCommissionByGoodsExtend(eg *xorm.Engine, dbName string, commissionP |
|
|
|
if virCfg != nil && virCfg.Val != "" { |
|
|
|
virType = virCfg.Val |
|
|
|
} |
|
|
|
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(eg, dbName) |
|
|
|
|
|
|
|
for _, param := range commissionParamList { |
|
|
|
param := param // 为下面的闭包创建局部变量 |
|
|
|
group.Go(func() error { |
|
|
@@ -99,7 +102,7 @@ func BatchGetCommissionByGoodsExtend(eg *xorm.Engine, dbName string, commissionP |
|
|
|
param.CommissionParam.IsGoods = "1" |
|
|
|
param.CommissionParam.IsShowExtend = param.IsShowExtend |
|
|
|
|
|
|
|
_, _, _, _, lvUser, err := svc.GetRewardCommission(eg, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType) |
|
|
|
_, _, _, _, lvUser, err := svc.GetRewardCommission(eg, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType, plan, commission, virtualCoinMoneyRate) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
@@ -135,6 +138,8 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar |
|
|
|
if virCfg != nil && virCfg.Val != "" { |
|
|
|
virType = virCfg.Val |
|
|
|
} |
|
|
|
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(engine, dbName) |
|
|
|
|
|
|
|
for _, param := range CommissionParamList { |
|
|
|
param := param // 为下面的闭包创建局部变量 |
|
|
|
group.Go(func() error { |
|
|
@@ -153,7 +158,7 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar |
|
|
|
param.CommissionParam.OldPrice = param.CommissionParam.GoodsPrice |
|
|
|
param.CommissionParam.Oid = param.Oid |
|
|
|
|
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(engine, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType) |
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(engine, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType, plan, commission, virtualCoinMoneyRate) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
@@ -200,9 +205,10 @@ func SettleCommWithGoodsDetail(eg *xorm.Engine, dbName string, CommissionParam m |
|
|
|
} |
|
|
|
CommissionParam.CommissionParam.Oid = CommissionParam.GoodsId |
|
|
|
CommissionParam.CommissionParam.IsGoods = "1" |
|
|
|
CommissionParam.CommissionParam.ShowLevel=CommissionParam.ShowLevel |
|
|
|
CommissionParam.CommissionParam.ShowLevel = CommissionParam.ShowLevel |
|
|
|
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(eg, dbName) |
|
|
|
|
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) |
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType, plan, commission, virtualCoinMoneyRate) |
|
|
|
return profit, pvdFee, sysFee, subsidyFee, lvUser, err |
|
|
|
} |
|
|
|
|
|
|
@@ -232,8 +238,9 @@ func SettleCommWithGoodsDetailExtend(eg *xorm.Engine, dbName string, CommissionP |
|
|
|
CommissionParam.CommissionParam.Oid = CommissionParam.GoodsId |
|
|
|
CommissionParam.CommissionParam.IsGoods = "1" |
|
|
|
CommissionParam.CommissionParam.IsShowExtend = CommissionParam.IsShowExtend |
|
|
|
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(eg, dbName) |
|
|
|
|
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) |
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType, plan, commission, virtualCoinMoneyRate) |
|
|
|
return profit, pvdFee, sysFee, subsidyFee, lvUser, err |
|
|
|
} |
|
|
|
func SettleCommWithOrder(eg *xorm.Engine, dbName string, CommissionParam md.CommissionFirstParam) (float64, float64, float64, float64, *comm_plan.LvUser, error) { |
|
|
@@ -259,7 +266,9 @@ func SettleCommWithOrder(eg *xorm.Engine, dbName string, CommissionParam md.Comm |
|
|
|
virType = virCfg.Val |
|
|
|
} |
|
|
|
CommissionParam.CommissionParam.Oid = CommissionParam.GoodsId |
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) |
|
|
|
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(eg, dbName) |
|
|
|
|
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType, plan, commission, virtualCoinMoneyRate) |
|
|
|
return profit, pvdFee, sysFee, subsidyFee, lvUser, err |
|
|
|
} |
|
|
|
|
|
|
@@ -282,18 +291,19 @@ func GetRewardCommission(eg *xorm.Engine, dbName, mode string, CommissionParam m |
|
|
|
} |
|
|
|
CommissionParam.CommissionParam.Oid = CommissionParam.GoodsId |
|
|
|
CommissionParam.CommissionParam.IsGoods = "1" |
|
|
|
CommissionParam.CommissionParam.ShowLevel=CommissionParam.ShowLevel |
|
|
|
CommissionParam.CommissionParam.ShowLevel = CommissionParam.ShowLevel |
|
|
|
plan, commissions, virtualCoinMoneyRate := svc.GetAllPlan(eg, dbName) |
|
|
|
|
|
|
|
var lvUser = &comm_plan.LvUser{} |
|
|
|
var mapsDta = map[string]string{"show_level": CommissionParam.ShowLevel} |
|
|
|
if isAll { |
|
|
|
shareCommission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, true, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode) |
|
|
|
commission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, false, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode) |
|
|
|
shareCommission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, true, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode, plan, commissions, virtualCoinMoneyRate) |
|
|
|
commission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, false, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode, plan, commissions, virtualCoinMoneyRate) |
|
|
|
} else { |
|
|
|
if isShare { |
|
|
|
shareCommission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode) |
|
|
|
shareCommission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode, plan, commissions, virtualCoinMoneyRate) |
|
|
|
} else { |
|
|
|
commission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode) |
|
|
|
commission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode, plan, commissions, virtualCoinMoneyRate) |
|
|
|
} |
|
|
|
} |
|
|
|
return commission, shareCommission, lvUser, nil |
|
|
|