|
|
@@ -147,3 +147,35 @@ func SettleCommWithGoodsDetail(eg *xorm.Engine, dbName string, CommissionParam m |
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) |
|
|
|
return profit, pvdFee, sysFee, subsidyFee, lvUser, err |
|
|
|
} |
|
|
|
|
|
|
|
//获取自购分享佣金的 |
|
|
|
func GetRewardCommission(eg *xorm.Engine, dbName, mode string, CommissionParam md.CommissionFirstParam) (float64, float64, *comm_plan.LvUser, error) { |
|
|
|
var ( |
|
|
|
isAll = false |
|
|
|
isShare = false |
|
|
|
isAllLevelReturn = false |
|
|
|
commission, shareCommission float64 |
|
|
|
) |
|
|
|
if CommissionParam.IsShare == 0 { |
|
|
|
isAll = true |
|
|
|
} |
|
|
|
if CommissionParam.IsShare == 1 { |
|
|
|
isShare = true |
|
|
|
} |
|
|
|
if CommissionParam.IsAllLevelReturn != 0 { |
|
|
|
isAllLevelReturn = true |
|
|
|
} |
|
|
|
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) |
|
|
|
} else { |
|
|
|
if isShare { |
|
|
|
shareCommission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode) |
|
|
|
} else { |
|
|
|
commission, _, _, _, lvUser, _ = svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapsDta, mode) |
|
|
|
} |
|
|
|
} |
|
|
|
return commission, shareCommission, lvUser, nil |
|
|
|
} |