From 7a5aadcb7c161bad936d3fb8aa40734985084735 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 29 Oct 2024 16:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/svc/svc_data_center_generate_data.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/svc/svc_data_center_generate_data.go b/app/svc/svc_data_center_generate_data.go index eb503bf..98e4634 100644 --- a/app/svc/svc_data_center_generate_data.go +++ b/app/svc/svc_data_center_generate_data.go @@ -14,6 +14,7 @@ import ( "fmt" "github.com/gin-gonic/gin" "github.com/jinzhu/copier" + "strings" "time" ) @@ -485,10 +486,28 @@ func comm(c *gin.Context, isTotal int, req md.DataCenterRecordReq) ([]map[string user := GetUser(c) mediumId := GetMediumIdStr(c, user.AdmId, "", "") if mediumId != "" { - 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 req.AppId != "" || req.Platform != "" { - where += " and app_id in('" + appId + "')" + ex := strings.Split(appId, ",") + str := "" + for _, v := range ex { + if str == "" { + str += "'" + v + "'" + } else { + str += ",'" + v + "'" + } + } + where += " and app_id in(" + str + ")" } if req.AdType != "" { where += " and ad_slot='" + req.AdType + "'"