From 2f6abf1faeba0ef8f465bc443781c4a0d68d40f8 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 29 Oct 2024 15:27:27 +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/hdl/hdl_data_center_generate_data.go | 4 ---- app/svc/svc_data_center_generate_data.go | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/hdl/hdl_data_center_generate_data.go b/app/hdl/hdl_data_center_generate_data.go index 2ee5486..5299904 100644 --- a/app/hdl/hdl_data_center_generate_data.go +++ b/app/hdl/hdl_data_center_generate_data.go @@ -211,10 +211,6 @@ func DataCenterTable(c *gin.Context) { e.OutErr(c, err1.Code, err1.Error()) return } - if req.StartDate == "" || req.EndDate == "" { - e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) - return - } res := svc.DataCenterTable(c, req) e.OutSuc(c, res, nil) return diff --git a/app/svc/svc_data_center_generate_data.go b/app/svc/svc_data_center_generate_data.go index 590c6a5..eb503bf 100644 --- a/app/svc/svc_data_center_generate_data.go +++ b/app/svc/svc_data_center_generate_data.go @@ -414,7 +414,7 @@ func DataCenterSelectData(c *gin.Context) { ids = append(ids, utils.IntToStr(v.MediumId)) } for _, v := range appList { - if utils.InArr(utils.IntToStr(v.MediumId), ids) == false { + if utils.InArr(utils.IntToStr(v.MediumId), ids) == false && user.IsSuperAdministrator != 1 { continue } _, ok := appMap[v.Platform] @@ -442,6 +442,7 @@ func DataCenterTable(c *gin.Context, req md.DataCenterTableReq) md.DataCenterTab var req1 md.DataCenterRecordReq copier.Copy(&req1, &req) nativeString, _ := comm(c, 0, req1) + list := make([]md.DataCenterTableData, 0) tmpMap := make(map[string]md.DataCenterTableData) for _, v := range nativeString { @@ -481,6 +482,11 @@ func comm(c *gin.Context, isTotal int, req md.DataCenterRecordReq) ([]map[string where %s %s ` where := "is_generate_report=1 and uuid=" + c.GetString("mid") + user := GetUser(c) + mediumId := GetMediumIdStr(c, user.AdmId, "", "") + if mediumId != "" { + where += " and medium_id in('" + mediumId + "')" + } if req.AppId != "" || req.Platform != "" { where += " and app_id in('" + appId + "')" }