1
0

marge: 合并代码

This commit is contained in:
TsMask
2023-12-29 20:22:43 +08:00
parent 615ab2eb2e
commit 3c5c77b881
39 changed files with 1571 additions and 289 deletions

View File

@@ -43,22 +43,9 @@ func (s *SysJobLogController) List(c *gin.Context) {
querys := ctx.QueryMap(c)
data := s.sysJobLogService.SelectJobLogPage(querys)
language := ctx.AcceptLanguage(c)
// 反查多语言key
querys["jobName"] = i18n.ValueKey(language, querys["jobName"].(string))
dataI18n := s.sysJobLogService.SelectJobLogPage(querys)
totalI18n := parse.Number(dataI18n["total"])
if totalI18n != 0 {
rows := data["rows"].([]model.SysJobLog)
total := parse.Number(data["total"])
rowsI18n := dataI18n["rows"].([]model.SysJobLog)
data["rows"] = append(rows, rowsI18n...)
data["total"] = total + totalI18n
}
rows := data["rows"].([]model.SysJobLog)
// 闭包函数处理多语言
language := ctx.AcceptLanguage(c)
converI18n := func(language string, arr *[]model.SysJobLog) {
for i := range *arr {
(*arr)[i].JobName = i18n.TKey(language, (*arr)[i].JobName)