소스 검색

update

master
dengbiao 1 개월 전
부모
커밋
32263a518f
2개의 변경된 파일13개의 추가작업 그리고 6개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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)


불러오는 중...
취소
저장