From e036395d185f21497424e754e8bdb990d169c3a1 Mon Sep 17 00:00:00 2001 From: pixelmaxQM Date: Thu, 31 Oct 2024 20:24:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20#1918=20=E5=9C=A8=E5=8C=85=E5=90=ABdelet?= =?UTF-8?q?e=5Fat=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E8=87=AA=E5=8A=A8=E8=BF=87=E6=BB=A4=E8=BD=AF?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/package/server/service/service.go.tpl | 4 ++-- server/resource/plugin/server/service/service.go.template | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/resource/package/server/service/service.go.tpl b/server/resource/package/server/service/service.go.tpl index 41885101cc..29c5864cb0 100644 --- a/server/resource/package/server/service/service.go.tpl +++ b/server/resource/package/server/service/service.go.tpl @@ -49,7 +49,7 @@ orderMap["{{.ColumnName}}"] = true {{- else}} {{ $dataDB = printf "global.MustGetGlobalDBByDBName(\"%s\")" $value.DBName }} {{- end}} -{{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NOT NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) +{{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) res["{{$key}}"] = {{$key}} {{- end }} {{- end }} @@ -204,7 +204,7 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}DataSou {{- else}} {{ $dataDB = printf "global.MustGetGlobalDBByDBName(\"%s\")" $value.DBName }} {{- end}} - {{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NOT NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) + {{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) res["{{$key}}"] = {{$key}} {{- end }} return diff --git a/server/resource/plugin/server/service/service.go.template b/server/resource/plugin/server/service/service.go.template index 13474cf4b3..1707eed253 100644 --- a/server/resource/plugin/server/service/service.go.template +++ b/server/resource/plugin/server/service/service.go.template @@ -49,7 +49,7 @@ orderMap["{{.ColumnName}}"] = true {{- else}} {{ $dataDB = printf "global.MustGetGlobalDBByDBName(\"%s\")" $value.DBName }} {{- end}} -{{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NOT NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) +{{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) res["{{$key}}"] = {{$key}} {{- end }} {{- end }} @@ -211,7 +211,7 @@ func (s *{{.Abbreviation}})Get{{.StructName}}DataSource() (res map[string][]map[ {{- else}} {{ $dataDB = printf "global.MustGetGlobalDBByDBName(\"%s\")" $value.DBName }} {{- end}} - {{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NOT NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) + {{$dataDB}}.Table("{{$value.Table}}"){{- if $value.HasDeletedAt}}.Where("deleted_at IS NULL"){{ end }}.Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}}) res["{{$key}}"] = {{$key}} {{- end }} return