This repository was archived by the owner on Oct 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,15 @@ func getColumn(code string, fields map[string]*kintone.FieldInfo) *Column {
124
124
return & column
125
125
}
126
126
127
+ func containtString (arr []string , str string ) bool {
128
+ for _ , a := range arr {
129
+ if a == str {
130
+ return true
131
+ }
132
+ }
133
+ return false
134
+ }
135
+
127
136
// set Cell information from fieldinfo
128
137
// function replace getColumn so getColumn is invalid name
129
138
func getCell (code string , fields map [string ]* kintone.FieldInfo ) * Cell {
@@ -270,7 +279,7 @@ func main() {
270
279
} else {
271
280
fields := config .Fields
272
281
isAppendIdCustome := false
273
- if len (config .Fields ) > 0 {
282
+ if len (config .Fields ) > 0 && ! containtString ( config . Fields , "$id" ) {
274
283
fields = append (fields , "$id" )
275
284
isAppendIdCustome = true
276
285
}
@@ -304,10 +313,9 @@ func main() {
304
313
} else {
305
314
fields := config .Fields
306
315
isAppendIdCustome := false
307
- if len (config .Fields ) > 0 {
316
+ if len (config .Fields ) > 0 && ! containtString ( config . Fields , "$id" ) {
308
317
fields = append (fields , "$id" )
309
318
isAppendIdCustome = true
310
-
311
319
}
312
320
err = exportRecordsBySeekMethod (app , writer , fields , isAppendIdCustome )
313
321
}
You can’t perform that action at this time.
0 commit comments