@@ -237,10 +237,27 @@ func commFinanceTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []strin | |||
} | |||
if 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 { | |||
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 == "" { | |||
req.Sort = "media_revenue desc" | |||
@@ -270,7 +287,15 @@ func commFinanceTotalByDate(c *gin.Context, startDate, endDate string, appId []s | |||
where += " and date<='" + endDate + "'" | |||
} | |||
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) | |||
nativeString, err := db.QueryNativeString(db.Db, sql) | |||
@@ -248,10 +248,27 @@ func commTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []ma | |||
} | |||
if 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 { | |||
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 == "" { | |||
req.Sort = "media_revenue desc" | |||
@@ -281,7 +298,15 @@ func commTotalByDate(c *gin.Context, startDate, endDate string, appId []string) | |||
where += " and date<='" + endDate + "'" | |||
} | |||
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) | |||
nativeString, err := db.QueryNativeString(db.Db, sql) | |||
@@ -169,7 +169,16 @@ func commOperatorTotal(c *gin.Context, startDate, endDate string) []map[string]s | |||
user := GetUser(c) | |||
appId := GetMediumIdStr(c, user.AdmId, "", "") | |||
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) | |||
nativeString, _ := db.QueryNativeString(db.Db, sql) | |||
@@ -205,10 +214,27 @@ func commOperatorTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []stri | |||
user := GetUser(c) | |||
appIds := GetMediumIdStr(c, user.AdmId, req.Name, "") | |||
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 { | |||
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 == "" { | |||
req.Sort = "media_revenue desc" | |||
@@ -238,7 +264,15 @@ func commOperatorTotalByDate(c *gin.Context, startDate, endDate string, appId [] | |||
where += " and date<='" + endDate + "'" | |||
} | |||
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) | |||
nativeString, err := db.QueryNativeString(db.Db, sql) | |||