From 6289257ac12fc269bdc71811e855c1997e5eb867 Mon Sep 17 00:00:00 2001 From: DEKA_123 <1904876928@qq.com> Date: Thu, 10 Aug 2023 14:54:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(#13):=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E7=94=B5=E8=B4=B9=E6=A0=B8=E7=AE=97=E6=97=B6=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=9B=AD=E5=8C=BA=E6=97=B6=E6=98=BE=E7=A4=BA=E5=9B=AD?= =?UTF-8?q?=E5=8C=BA=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=9F=90=E4=B8=80=E5=9B=AD=E5=8C=BA=E6=97=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=90=8C=E5=9B=AD=E5=8C=BA=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/report.go | 3 +-- repository/report.go | 4 +--- settings.yaml | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/controller/report.go b/controller/report.go index 3f10220..232a929 100644 --- a/controller/report.go +++ b/controller/report.go @@ -396,7 +396,7 @@ func reportComprehensiveSearch(c *fiber.Ctx) error { reportLog.Error("无法获取当前用户的会话信息", zap.Error(err)) return result.Unauthorized("无法获取当前用户的会话信息。") } - park := tools.EmptyToNil(c.Query("park_id")) + park := tools.EmptyToNil(c.Query("park")) if session.Type == model.USER_TYPE_ENT && park != nil && len(*park) > 0 { if pass, err := checkParkBelongs(*park, reportLog, c, &result); !pass { return err @@ -420,7 +420,6 @@ func reportComprehensiveSearch(c *fiber.Ctx) error { reportLog.Error("无法解析核算报表查询的结束日期", zap.Error(err)) return result.BadRequest("无法解析核算报表查询的结束日期。") } - reports, total, err := service.ReportService.QueryReports(requestUser, park, uint(page), keyword, startDate, endDate) if err != nil { reportLog.Error("无法查询核算报表", zap.Error(err)) diff --git a/repository/report.go b/repository/report.go index 90526ad..97cd3b6 100644 --- a/repository/report.go +++ b/repository/report.go @@ -630,7 +630,7 @@ func (rr _ReportRepository) ComprehensiveReportSearch(uid, pid *string, page uin countQuery = countQuery.Where(goqu.I("ud.id").Eq(*uid)) } - if pid != nil && len(*pid) > 0 { + if pid != nil && *pid != "" { reportQuery = reportQuery.Where(goqu.I("p.id").Eq(*pid)) countQuery = countQuery.Where(goqu.I("p.id").Eq(*pid)) } @@ -681,8 +681,6 @@ func (rr _ReportRepository) ComprehensiveReportSearch(uid, pid *string, page uin rr.log.Error("对指定核算报表进行综合检索总数量时出现错误", zap.Error(err)) return reports, 0, err } - log.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>", querySql, "1111111111111111111111", countSql, "????????????", count) - return reports, count, nil } diff --git a/settings.yaml b/settings.yaml index 7620533..84db9ed 100644 --- a/settings.yaml +++ b/settings.yaml @@ -12,9 +12,9 @@ Server: ReadTimeout: 60 WriteTimeout: 60 Redis: - Host: 127.0.0.1 + Host: 192.168.88.129 Port: 6379 - Password: + Password: 123456 DB: 1 Service: MaxSessionLife: 2h