Jianghan 1 year ago
parent
commit
23b43f7e2c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      service/exprot.go

+ 3 - 1
service/exprot.go

@@ -282,7 +282,9 @@ func hName(sql string) []interface{} {
 	keystr := strings.ReplaceAll(s[0], "select", "")
 	keystr = strings.ReplaceAll(keystr, " ", "")
 	for _, s1 := range strings.Split(keystr, ",") {
-		key = append(key, strings.Split(s1, "as")[1])
+		if strings.Contains(s1, "as") {
+			key = append(key, strings.Split(s1, "as")[1])
+		}
 	}
 	return key
 }