浏览代码

更新

master
huangjiajun 1周前
父节点
当前提交
8d9f2c15bf
共有 3 个文件被更改,包括 25 次插入4 次删除
  1. +7
    -3
      app/svc/svc_data_center_generate_data.go
  2. +17
    -0
      app/svc/svc_data_center_original_data.go
  3. +1
    -1
      go.mod

+ 7
- 3
app/svc/svc_data_center_generate_data.go 查看文件

@@ -71,7 +71,9 @@ func DataCenterIncomeDataList(c *gin.Context, req md.DataCenterGenerateDataReq)
appId := GetAppletId(c, req.Name, req.Platform, req.AppId)
mediumId := GetMediumIdStr(c, user.AdmId, "", "")
slotId := GetSlotId(c, req.State)
MediumList, total, _ := NewGenerateWxAdDataDb.FindGenerateWxAdDataListMedium(c.GetString("mid"), appId, mediumId, slotId, req.AdType, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
_, adType := GetSlotIds(c, req.AdType)

MediumList, total, _ := NewGenerateWxAdDataDb.FindGenerateWxAdDataListMedium(c.GetString("mid"), appId, mediumId, slotId, adType, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
data := make([]md.DataCenterIncomeDataData, 0)
if len(MediumList) > 0 {
for _, v := range MediumList {
@@ -120,8 +122,9 @@ func DataCenterIncomeDataListOutput(c *gin.Context, req md.DataCenterGenerateDat
appId := GetAppletId(c, req.Name, req.Platform, req.AppId)
mediumId := GetMediumIdStr(c, user.AdmId, "", "")
slotId := GetSlotId(c, req.State)
_, adType := GetSlotIds(c, req.AdType)
req.Limit = "3000"
MediumList, _ := NewGenerateWxAdDataDb.FindGenerateWxAdDataListMediumAll(c.GetString("mid"), appId, mediumId, slotId, req.AdType, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
MediumList, _ := NewGenerateWxAdDataDb.FindGenerateWxAdDataListMediumAll(c.GetString("mid"), appId, mediumId, slotId, adType, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
data := map[string]string{
"A1": "名称",
"B1": "日期",
@@ -510,7 +513,8 @@ func comm(c *gin.Context, isTotal int, req md.DataCenterRecordReq) ([]map[string
where += " and app_id in(" + str + ")"
}
if req.AdType != "" {
where += " and ad_slot='" + req.AdType + "'"
adType, _ := GetSlotIds(c, req.AdType)
where += " and slot_id in(" + adType + ")"
}
if req.StartDate != "" {
where += " and date>='" + req.StartDate + "'"


+ 17
- 0
app/svc/svc_data_center_original_data.go 查看文件

@@ -429,6 +429,23 @@ func GetSlotId(c *gin.Context, state string) string {
}
return mediumId
}
func GetSlotIds(c *gin.Context, adType string) (string, string) {
adId := ""
adIds := ""
if adType != "" {
adId = "'-1'"
ids := []string{"-1"}
var tmp []model2.AppletApplicationAdSpaceList
MasterDb(c).Where("kind=?", adType).Find(&tmp)
for _, v := range tmp {
adId += ",'" + v.AdId + "'"
ids = append(ids, v.AdId)
}
adIds = strings.Join(ids, ",")

}
return adId, adIds
}

// 应用
func GetAppletInfo(c *gin.Context, id string) map[string]string {


+ 1
- 1
go.mod 查看文件

@@ -36,7 +36,7 @@ require (
require (
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20240830072333-a1980ffb256e
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20241029082303-49c46bad02b0
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20241029093801-ac7d9e08df0e
github.com/360EntSecGroup-Skylar/excelize v1.4.1
github.com/gin-contrib/cors v1.7.2
github.com/jinzhu/copier v0.4.0


正在加载...
取消
保存