Browse Source

更新

master
huangjiajun 1 month ago
parent
commit
0c1389fead
2 changed files with 29 additions and 1 deletions
  1. +9
    -1
      app/md/md_data_center_original_data.go
  2. +20
    -0
      app/svc/svc_data_center_original_data.go

+ 9
- 1
app/md/md_data_center_original_data.go View File

@@ -46,7 +46,9 @@ type DataCenterOriginalDataData struct {
}

type DataCenterOriginalDataCommReq struct {
Id string `json:"id" example:"列表id"`
Id string `json:"id" example:"列表id"`
NowExposureCount string `json:"now_exposure_count" example:"现-曝光量"`
NowEcpm string `json:"now_ecpm" example:"现-广告千次曝光收益(元)"`
}
type DataCenterDataCenterOriginalDataDoingReq struct {
Id string `json:"id" example:"列表id"`
@@ -130,4 +132,10 @@ type MediumDivisionStrategy struct {
ExposureCount string `json:"exposure_count" example:"曝光量"`
OldEcpm string `json:"old_ecpm" example:"原-ecpm(元)"`
Ecpm string `json:"ecpm" example:"现-ecpm(元)"`
PlatformRetention string `json:"platform_retention" example:"平台留存"`
CommissionRetention string `json:"commission_retention" example:"佣金留存"`
MediaRevenue string `json:"media_revenue" example:"媒体收益"`
AgentRevenue string `json:"agent_revenue" example:"代理收益"`
ExtraRevenue string `json:"extra_revenue" example:"额外收益"`
AgreementSharing string `json:"agreement_sharing" example:"协议分成"`
}

+ 20
- 0
app/svc/svc_data_center_original_data.go View File

@@ -171,6 +171,20 @@ func DataCenterOriginalDataTotal(c *gin.Context, req md.DataCenterOriginalDataCo
}
_, ecpm := ClacEcpm(ecpmReq)
fmt.Println(utils.Float64ToStr(utils.StrToFloat64(ecpm) / 100))
param := md.CalcApplicationDataReq{
OriginalDataId: data.Id,
OriginalExposureCount: data.ExposureCount,
OriginalEcpm: data.Ecpm,
NowExposureCount: data.ExposureCount,
NowEcpm: ecpm,
}
if utils.StrToFloat64(req.NowEcpm) > 0 {
param.NowEcpm = utils.Float64ToStr(utils.StrToFloat64(req.NowEcpm) * 100)
}
if utils.StrToFloat64(req.NowExposureCount) > 0 {
param.NowExposureCount = utils.StrToInt(req.NowExposureCount)
}
_, appData := CalcApplicationData(param)
res := md.MediumDivisionStrategy{
PlatformRetentionRate: utils.IntToStr(strategy.PlatformRetentionRate),
CommissionRetentionRate: utils.IntToStr(strategy.CommissionRetentionRate),
@@ -181,6 +195,12 @@ func DataCenterOriginalDataTotal(c *gin.Context, req md.DataCenterOriginalDataCo
ExposureCount: utils.IntToStr(data.ExposureCount),
Ecpm: utils.Float64ToStr(utils.StrToFloat64(ecpm) / 100),
OldEcpm: utils.Float64ToStr(utils.StrToFloat64(data.Ecpm) / 100),
PlatformRetention: utils.Float64ToStr(appData.PlatformRetention / 100),
CommissionRetention: utils.Float64ToStr(appData.CommissionRetention / 100),
MediaRevenue: utils.Float64ToStr(appData.MediaRevenue / 100),
AgentRevenue: utils.Float64ToStr(appData.AgentRevenue / 100),
ExtraRevenue: utils.Float64ToStr(appData.ExtraRevenue / 100),
AgreementSharing: utils.Float64ToStr(appData.AgreementSharing / 100),
}
e.OutSuc(c, res, nil)
return


Loading…
Cancel
Save