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