From b38c49b00202e79f6c51f2e2e865dc850fb51371 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Sat, 20 Apr 2024 09:59:30 +0800 Subject: [PATCH 1/3] fix: ent page count bug --- extra/ent/template/tmpl/pagination.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/ent/template/tmpl/pagination.tmpl b/extra/ent/template/tmpl/pagination.tmpl index 4b7ee22..e00ea76 100644 --- a/extra/ent/template/tmpl/pagination.tmpl +++ b/extra/ent/template/tmpl/pagination.tmpl @@ -140,7 +140,9 @@ in the LICENSE file in the root directory of this source tree. Size: pageSize, } - count, err := {{ $r }}.Clone().Count(ctx) + query := {{ $r }}.Clone() + query.ctx.Fields = nil + count, err := query.Count(ctx) if err != nil { return nil, err From ba7e8576f2abd262026970a1546a9c768f87c7e8 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Sat, 20 Apr 2024 10:02:26 +0800 Subject: [PATCH 2/3] chore: upgrade version --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 0232388..230a18f 100644 --- a/config/config.go +++ b/config/config.go @@ -18,7 +18,7 @@ var OldGoZeroVersion = []string{"v1.5.6", "v1.6.0", "v1.6.1", "v1.6.2", "v1.6.3" const DefaultToolVersion = "v1.6.10" // GoctlsVersion is goctls version -const GoctlsVersion = "v1.7.0" +const GoctlsVersion = "v1.7.1" // CoreVersion is the core service version. const CoreVersion = "v1.4.0" From d64a033e5fee622ce3f04e51a4ef3243e67ad759 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Sat, 20 Apr 2024 10:04:27 +0800 Subject: [PATCH 3/3] fix: optimize template format --- extra/ent/template/tmpl/pagination.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/ent/template/tmpl/pagination.tmpl b/extra/ent/template/tmpl/pagination.tmpl index e00ea76..e2f6bb2 100644 --- a/extra/ent/template/tmpl/pagination.tmpl +++ b/extra/ent/template/tmpl/pagination.tmpl @@ -140,7 +140,7 @@ in the LICENSE file in the root directory of this source tree. Size: pageSize, } - query := {{ $r }}.Clone() + query := {{ $r }}.Clone() query.ctx.Fields = nil count, err := query.Count(ctx)