|
@@ -43,8 +43,8 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode |
|
|
|
|
|
|
|
|
// 3、计算媒体、代理收益、平台留存、佣金留存、协议分成、协议总分成 |
|
|
// 3、计算媒体、代理收益、平台留存、佣金留存、协议分成、协议总分成 |
|
|
publisherIncome := float64(originalWxAdData.PublisherIncome) |
|
|
publisherIncome := float64(originalWxAdData.PublisherIncome) |
|
|
mediaRevenue := publisherIncome * float64(mediumDivisionStrategy.MediaRevenueRate) / 100 // 媒体收益 |
|
|
|
|
|
agentRevenue := publisherIncome * float64(mediumDivisionStrategy.AgentRevenueRate) / 100 // 代理收益 |
|
|
|
|
|
|
|
|
mediaRevenue := utils.RoundToTwoDecimalPlaces(publisherIncome * float64(mediumDivisionStrategy.MediaRevenueRate) / 100) // 媒体收益 |
|
|
|
|
|
agentRevenue := utils.RoundToTwoDecimalPlaces(publisherIncome * float64(mediumDivisionStrategy.AgentRevenueRate) / 100) // 代理收益 |
|
|
platformRetention := publisherIncome * float64(mediumDivisionStrategy.PlatformRetentionRate) / 100 // 平台留存 |
|
|
platformRetention := publisherIncome * float64(mediumDivisionStrategy.PlatformRetentionRate) / 100 // 平台留存 |
|
|
commissionRetention := publisherIncome * float64(mediumDivisionStrategy.CommissionRetentionRate) / 100 // 佣金留存 |
|
|
commissionRetention := publisherIncome * float64(mediumDivisionStrategy.CommissionRetentionRate) / 100 // 佣金留存 |
|
|
agreementSharingTotal := (mediaRevenue + agentRevenue) / ((100 - float64(mediumDivisionStrategy.AgreementSharingRate)) / 100) // 协议总分成(倒推) |
|
|
agreementSharingTotal := (mediaRevenue + agentRevenue) / ((100 - float64(mediumDivisionStrategy.AgreementSharingRate)) / 100) // 协议总分成(倒推) |
|
@@ -75,7 +75,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode |
|
|
ExtraRevenue int `json:"extra_revenue"` |
|
|
ExtraRevenue int `json:"extra_revenue"` |
|
|
} |
|
|
} |
|
|
for _, v := range *mediumDivisionStrategyWithAgentFlows { |
|
|
for _, v := range *mediumDivisionStrategyWithAgentFlows { |
|
|
tmpAgentRevenue := agentRevenue * float64(v.AgentRevenueRate) / 100 |
|
|
|
|
|
|
|
|
tmpAgentRevenue := utils.RoundToTwoDecimalPlaces(agentRevenue * float64(v.AgentRevenueRate) / 100) |
|
|
tmpExtraRevenue := commissionRetention * float64(v.ExtraRevenueRate) / 100 |
|
|
tmpExtraRevenue := commissionRetention * float64(v.ExtraRevenueRate) / 100 |
|
|
extraRevenue += tmpExtraRevenue |
|
|
extraRevenue += tmpExtraRevenue |
|
|
agentRevenueFlows = append(agentRevenueFlows, struct { |
|
|
agentRevenueFlows = append(agentRevenueFlows, struct { |
|
|