forked from mirror/gorm
Handle []string for Select
This commit is contained in:
parent
edecbde19d
commit
5af077cd2d
2
scope.go
2
scope.go
|
@ -368,6 +368,8 @@ func (scope *Scope) SelectAttrs() []string {
|
|||
for _, value := range scope.Search.selects {
|
||||
if str, ok := value.(string); ok {
|
||||
attrs = append(attrs, str)
|
||||
} else if strs, ok := value.([]string); ok {
|
||||
attrs = append(attrs, strs...)
|
||||
} else if strs, ok := value.([]interface{}); ok {
|
||||
for _, str := range strs {
|
||||
attrs = append(attrs, fmt.Sprintf("%v", str))
|
||||
|
|
Loading…
Reference in New Issue