Browse Source

update

master
dengbiao 1 month ago
parent
commit
32263a518f
2 changed files with 13 additions and 6 deletions
  1. +5
    -5
      app/svc/svc_data_center_original_data.go
  2. +8
    -1
      app/svc/svc_wx_data.go

+ 5
- 5
app/svc/svc_data_center_original_data.go View File

@@ -150,14 +150,14 @@ func DataCenterOriginalDataTotal(c *gin.Context, req md.DataCenterOriginalDataCo
e.OutErr(c, 400, e.NewErr(400, "记录不存在"))
return
}
//应用
// 应用
NewAppletApplicationDb := implement2.NewAppletApplicationDb(MasterDb(c))
appid, _ := NewAppletApplicationDb.GetAppletApplicationListByAppid(data.AppId)
if appid == nil {
e.OutErr(c, 400, e.NewErr(400, "应用不存在"))
return
}
//分成策略
// 分成策略
NewMediumDivisionStrategyDb := implement.NewMediumDivisionStrategyDb(db.Db)
strategy, _ := NewMediumDivisionStrategyDb.GetOriginalWxAdDataByMediumId(appid.MediumId)
if strategy == nil {
@@ -170,7 +170,7 @@ func DataCenterOriginalDataTotal(c *gin.Context, req md.DataCenterOriginalDataCo
GenerateDataId: data.Id,
}
_, ecpm := ClacEcpm(ecpmReq)
fmt.Println(utils.Float64ToStr(utils.StrToFloat64(ecpm) / 100))
res := md.MediumDivisionStrategy{
PlatformRetentionRate: utils.IntToStr(strategy.PlatformRetentionRate),
CommissionRetentionRate: utils.IntToStr(strategy.CommissionRetentionRate),
@@ -208,7 +208,7 @@ func DataCenterOriginalDataDoing(c *gin.Context, req md.DataCenterDataCenterOrig
OriginalExposureCount: data.ExposureCount,
OriginalEcpm: data.Ecpm,
NowExposureCount: utils.StrToInt(req.NowExposureCount),
NowEcpm: utils.Float64ToStr(utils.StrToFloat64(req.NowEcpm) * 100),
NowEcpm: req.NowEcpm,
}
err, _ = GenerateWxAdData(args)
if err != nil {
@@ -285,7 +285,7 @@ func OriginalDataMoreApplicationDoing(c *gin.Context, req md.DataCenterOriginalD
return nil
}
func OriginalDataOneApplicationTotal(c *gin.Context, req md.DataCenterOriginalDataOneApplicationDoingReq) {
//1、查找对应 user_wx_applet_list 记录
// 1、查找对应 user_wx_applet_list 记录
userWxAppletListDb := implement.NewUserWxAppletListDb(db.Db)
masterId := c.GetString("mid")
UserWxAppletList, err := userWxAppletListDb.GetUserWxAppletList(masterId)


+ 8
- 1
app/svc/svc_wx_data.go View File

@@ -52,7 +52,14 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode

// 3、判断是否有调价留存
var priceAdjustmentRetention int
if req.NowEcpm != req.OriginalEcpm || req.NowExposureCount != req.OriginalExposureCount {
ecpmReq := md.ClacEcpmReq{
OriginalExposureCount: originalWxAdData.ExposureCount,
OriginalEcpm: originalWxAdData.Ecpm,
GenerateDataId: originalWxAdData.Id,
}
_, ecpm := ClacEcpm(ecpmReq)
fmt.Println(utils.Float64ToStr(utils.StrToFloat64(ecpm) / 100))
if req.NowEcpm != utils.Float64ToStr(utils.StrToFloat64(ecpm)/100) || req.NowExposureCount != req.OriginalExposureCount {
tmpMediaRevenue := int(utils.StrToFloat64(req.NowEcpm) * float64(req.NowExposureCount) / 1000)
priceAdjustmentRetention = int(float64(tmpMediaRevenue) - mediaRevenue)
mediaRevenue = float64(tmpMediaRevenue)


Loading…
Cancel
Save