瀏覽代碼

Merge remote-tracking branch 'origin/master'

master
huangjiajun 2 月之前
父節點
當前提交
8938c64e2a
共有 2 個檔案被更改,包括 14 行新增12 行删除
  1. +13
    -11
      app/svc/svc_data_center.go
  2. +1
    -1
      go.mod

+ 13
- 11
app/svc/svc_data_center.go 查看文件

@@ -119,7 +119,7 @@ func DataCenterRecordOutPut(c *gin.Context, req md.DataCenterRecordOutPutReq) {
adMap[v.AdId] = v
}
name := req.StartDate + "~" + req.EndDate + "(第" + req.Page + "页 " + utils.IntToStr(len(nativeString)) + "条)"
//写入数据
// 写入数据
data := map[string]string{
"A1": "日期",
"B1": "应用名称",
@@ -278,7 +278,7 @@ func DataCenterCommissionRecordOutPut(c *gin.Context, req md.DataCenterRecordOut
adMap[v.AdId] = v
}
name := req.StartDate + "~" + req.EndDate + "(第" + req.Page + "页 " + utils.IntToStr(len(nativeString)) + "条)"
//写入数据
// 写入数据
data := map[string]string{
"A1": "日期",
"B1": "应用名称",
@@ -331,7 +331,7 @@ func DataCenterProfitRecordOutPut(c *gin.Context, req md.DataCenterProfitRecordO
}

name := req.StartDate + "~" + req.EndDate + "(第" + req.Page + "页 " + utils.IntToStr(len(nativeString)) + "条)"
//写入数据
// 写入数据
data := map[string]string{
"A1": "日期",
"B1": "应用名称",
@@ -440,29 +440,31 @@ func commAgentProfit(c *gin.Context, isTotal int, req md.DataCenterProfitRecordR
sql := `
SELECT
%s
FROM generate_wx_ad_data_with_agent_flow
FROM generate_wx_ad_data_with_agent_flow as gf
LEFT JOIN generate_wx_ad_data AS g
ON gf.generate_data_id = g.id
where %s %s
`
user := GetUser(c)
where := "is_generate_report=1 and uuid=" + c.GetString("mid") + " and agent_id =" + utils.IntToStr(user.AgentId)
where := "g.is_generate_report=1 and gf.uuid=" + c.GetString("mid") + " and gf.agent_id =" + utils.IntToStr(user.AgentId)
if req.AppId != "" || req.Platform != "" {
where += " and app_id in(" + appId + ")"
where += " and gf.app_id in(" + appId + ")"
}
if req.StartDate != "" {
where += " and date>='" + req.StartDate + "'"
where += " and gf.date >= '" + req.StartDate + "'"
}
if req.EndDate != "" {
where += " and date<='" + req.EndDate + "'"
where += " and gf.date<= '" + req.EndDate + "'"
}
field := `%s,app_id,SUM(agent_revenue) as agent_revenue,SUM(extra_revenue) as extra_revenue`
field := `%s,gf.app_id,SUM(gf.agent_revenue) as agent_revenue,SUM(gf.extra_revenue) as extra_revenue`
start := (utils.StrToInt(req.Page) - 1) * utils.StrToInt(req.Limit)
groupBy := " group by %s,app_id order by date desc,id desc"
groupBy := " group by %s,gf.app_id order by gf.date desc,gf.id desc"
if req.Page != "" {
groupBy += " limit " + utils.IntToStr(start) + "," + req.Limit
} else {
groupBy = " group by %s,app_id order by date asc,id asc"
}
timeStr := "date"
timeStr := "gf.date"
if req.Type == "1" {
timeStr = "DATE_FORMAT(date, '%Y-%m')"
}


+ 1
- 1
go.mod 查看文件

@@ -37,7 +37,7 @@ require (
)

require (
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20241009031730-6c5d31eb7458
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20241009095023-24f5079bb959
github.com/360EntSecGroup-Skylar/excelize v1.4.1
)



Loading…
取消
儲存