优化如果join表时出现重复的字段或者需要有函数时可以导出别名的值 (#1761)
This commit is contained in:
@@ -223,9 +223,14 @@ func (sysExportTemplateService *SysExportTemplateService) ExportExcel(templateID
|
||||
var row []string
|
||||
for _, column := range columns {
|
||||
if len(template.JoinTemplate) > 0 {
|
||||
columnArr := strings.Split(column, ".")
|
||||
if len(columnArr) > 1 {
|
||||
column = strings.Split(column, ".")[1]
|
||||
columnAs := strings.Split(column, " as ")
|
||||
if len(columnAs) > 1 {
|
||||
column = strings.TrimSpace(strings.Split(column, " as ")[1])
|
||||
} else {
|
||||
columnArr := strings.Split(column, ".")
|
||||
if len(columnArr) > 1 {
|
||||
column = strings.Split(column, ".")[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
row = append(row, fmt.Sprintf("%v", table[column]))
|
||||
|
Reference in New Issue
Block a user