Browse Source

更新

master
huangjiajun 3 weeks ago
parent
commit
5a95bdef37
3 changed files with 94 additions and 10 deletions
  1. +28
    -3
      app/svc/svc_finance_index.go
  2. +28
    -3
      app/svc/svc_index.go
  3. +38
    -4
      app/svc/svc_operator_index.go

+ 28
- 3
app/svc/svc_finance_index.go View File

@@ -237,10 +237,27 @@ func commFinanceTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []strin
} }
if req.Name != "" { if req.Name != "" {
mediumId := GetMediumId(c, req.Name) mediumId := GetMediumId(c, req.Name)
where += " and medium_id in(" + mediumId + ")"
ex := strings.Split(mediumId, ",")
str := ""
for _, v := range ex {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and medium_id in(" + str + ")"
} }
if len(appId) > 0 { if len(appId) > 0 {
where += " and app_id in('" + strings.Join(appId, ",") + "')"
str := ""
for _, v := range appId {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and app_id in(" + str + ")"
} }
if req.Sort == "" { if req.Sort == "" {
req.Sort = "media_revenue desc" req.Sort = "media_revenue desc"
@@ -270,7 +287,15 @@ func commFinanceTotalByDate(c *gin.Context, startDate, endDate string, appId []s
where += " and date<='" + endDate + "'" where += " and date<='" + endDate + "'"
} }
if len(appId) > 0 { if len(appId) > 0 {
where += " and app_id in('" + strings.Join(appId, ",") + "')"
str := ""
for _, v := range appId {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and app_id in(" + str + ")"
} }
sql = fmt.Sprintf(sql, where) sql = fmt.Sprintf(sql, where)
nativeString, err := db.QueryNativeString(db.Db, sql) nativeString, err := db.QueryNativeString(db.Db, sql)


+ 28
- 3
app/svc/svc_index.go View File

@@ -248,10 +248,27 @@ func commTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []ma
} }
if req.Name != "" { if req.Name != "" {
mediumId := GetMediumId(c, req.Name) mediumId := GetMediumId(c, req.Name)
where += " and medium_id in(" + mediumId + ")"
ex := strings.Split(mediumId, ",")
str := ""
for _, v := range ex {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and medium_id in(" + str + ")"
} }
if len(appId) > 0 { if len(appId) > 0 {
where += " and app_id in('" + strings.Join(appId, ",") + "')"
str := ""
for _, v := range appId {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and app_id in(" + str + ")"
} }
if req.Sort == "" { if req.Sort == "" {
req.Sort = "media_revenue desc" req.Sort = "media_revenue desc"
@@ -281,7 +298,15 @@ func commTotalByDate(c *gin.Context, startDate, endDate string, appId []string)
where += " and date<='" + endDate + "'" where += " and date<='" + endDate + "'"
} }
if len(appId) > 0 { if len(appId) > 0 {
where += " and app_id in('" + strings.Join(appId, ",") + "')"
str := ""
for _, v := range appId {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and app_id in(" + str + ")"
} }
sql = fmt.Sprintf(sql, where) sql = fmt.Sprintf(sql, where)
nativeString, err := db.QueryNativeString(db.Db, sql) nativeString, err := db.QueryNativeString(db.Db, sql)


+ 38
- 4
app/svc/svc_operator_index.go View File

@@ -169,7 +169,16 @@ func commOperatorTotal(c *gin.Context, startDate, endDate string) []map[string]s
user := GetUser(c) user := GetUser(c)
appId := GetMediumIdStr(c, user.AdmId, "", "") appId := GetMediumIdStr(c, user.AdmId, "", "")
if appId != "" { if appId != "" {
where += " and medium_id in(" + appId + ")"
ex := strings.Split(appId, ",")
str := ""
for _, v := range ex {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and medium_id in(" + str + ")"
} }
sql = fmt.Sprintf(sql, where) sql = fmt.Sprintf(sql, where)
nativeString, _ := db.QueryNativeString(db.Db, sql) nativeString, _ := db.QueryNativeString(db.Db, sql)
@@ -205,10 +214,27 @@ func commOperatorTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []stri
user := GetUser(c) user := GetUser(c)
appIds := GetMediumIdStr(c, user.AdmId, req.Name, "") appIds := GetMediumIdStr(c, user.AdmId, req.Name, "")
if appIds != "" { if appIds != "" {
where += " and medium_id in(" + appIds + ")"
ex := strings.Split(appIds, ",")
str := ""
for _, v := range ex {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and medium_id in(" + str + ")"
} }
if len(appId) > 0 { if len(appId) > 0 {
where += " and app_id in('" + strings.Join(appId, ",") + "')"
str := ""
for _, v := range appId {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and app_id in(" + str + ")"
} }
if req.Sort == "" { if req.Sort == "" {
req.Sort = "media_revenue desc" req.Sort = "media_revenue desc"
@@ -238,7 +264,15 @@ func commOperatorTotalByDate(c *gin.Context, startDate, endDate string, appId []
where += " and date<='" + endDate + "'" where += " and date<='" + endDate + "'"
} }
if len(appId) > 0 { if len(appId) > 0 {
where += " and app_id in('" + strings.Join(appId, ",") + "')"
str := ""
for _, v := range appId {
if str == "" {
str += "'" + v + "'"
} else {
str += ",'" + v + "'"
}
}
where += " and app_id in(" + str + ")"
} }
sql = fmt.Sprintf(sql, where) sql = fmt.Sprintf(sql, where)
nativeString, err := db.QueryNativeString(db.Db, sql) nativeString, err := db.QueryNativeString(db.Db, sql)


Loading…
Cancel
Save