From 3294245595c95dcf0181271497057c52e25f1fe2 Mon Sep 17 00:00:00 2001 From: jiangyong Date: Thu, 11 Sep 2025 18:43:05 +0800 Subject: [PATCH] select value --- qyweixin/app_approve.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qyweixin/app_approve.go b/qyweixin/app_approve.go index 9a4a651..f343a23 100644 --- a/qyweixin/app_approve.go +++ b/qyweixin/app_approve.go @@ -4,9 +4,10 @@ import ( "encoding/json" "fmt" "git.u8t.cn/open/gosdk/util" - log "github.com/sirupsen/logrus" "git.u8t.cn/open/goutil" + log "github.com/sirupsen/logrus" "github.com/spf13/cast" + "strings" ) type Applyer struct { @@ -148,10 +149,14 @@ func (d *ApproveDetail) GetData() map[string]string { var value string if content.Control == "Selector" { - for _, v := range content.Value.Selector.Options[0].Value { - if v.Text != "" { - value = v.Text + if len(content.Value.Selector.Options) > 0 { + values := make([]string, 0) + for _, v := range content.Value.Selector.Options[0].Value { + if v.Text != "" { + values = append(values, v.Text) + } } + value = strings.Join(values, ",") } } else if content.Control == "Text" || content.Control == "Textarea" { value = content.Value.Text