From 9ad7093d70fa03bdcb3c4968ce0f2972b10825a0 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 16 Nov 2021 08:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E8=BF=90?= =?UTF-8?q?=E8=90=A5=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=95=B0=E5=8F=AF=E9=80=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 2 +- routers/repo/user_data_analysis.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 8eb980471..f0bdbc950 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -154,7 +154,7 @@ func QueryUserStaticDataPage(opts *UserBusinessAnalysisQueryOptions) ([]*UserBus var cond = builder.NewCond() if len(opts.UserName) > 0 { cond = cond.And( - builder.Eq{"name": opts.UserName}, + builder.Like{"name", opts.UserName}, ) } cond = cond.And( diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index e24416d4f..2737116bf 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -29,6 +29,10 @@ func QueryUserStaticDataPage(ctx *context.Context) { if page <= 0 { page = 1 } + pageSize := ctx.QueryInt("pageSize") + if pageSize <= 0 { + pageSize = setting.UI.IssuePagingNum + } userName := ctx.Query("userName") log.Info("startDate=" + startDate + " endDate=" + endDate + " userName=" + userName + " page=" + fmt.Sprint(page)) @@ -39,7 +43,7 @@ func QueryUserStaticDataPage(ctx *context.Context) { pageOpts := &models.UserBusinessAnalysisQueryOptions{ ListOptions: models.ListOptions{ Page: page, - PageSize: setting.UI.IssuePagingNum, + PageSize: pageSize, }, UserName: userName, StartTime: startTime.Unix(),