merge: 合并OMC分支
This commit is contained in:
@@ -35,12 +35,17 @@ type SysConfigController struct {
|
||||
//
|
||||
// GET /list
|
||||
func (s *SysConfigController) List(c *gin.Context) {
|
||||
querys := ctx.QueryMap(c)
|
||||
data := s.sysConfigService.SelectConfigPage(querys)
|
||||
|
||||
rows := data["rows"].([]model.SysConfig)
|
||||
// 闭包函数处理多语言
|
||||
language := ctx.AcceptLanguage(c)
|
||||
querys := ctx.QueryMap(c)
|
||||
// 多语言值转key查询
|
||||
if v, ok := querys["configName"]; ok && v != "" {
|
||||
querys["configName"] = i18n.TFindKeyPrefix(language, "config", v.(string))
|
||||
}
|
||||
|
||||
data := s.sysConfigService.SelectConfigPage(querys)
|
||||
rows := data["rows"].([]model.SysConfig)
|
||||
|
||||
// 闭包函数处理多语言
|
||||
converI18n := func(language string, arr *[]model.SysConfig) {
|
||||
for i := range *arr {
|
||||
(*arr)[i].ConfigName = i18n.TKey(language, (*arr)[i].ConfigName)
|
||||
@@ -222,8 +227,10 @@ func (s *SysConfigController) Export(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
// 查询结果,根据查询条件结果,单页最大值限制
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
querys["pageNum"] = 1
|
||||
querys["pageSize"] = 1000
|
||||
data := s.sysConfigService.SelectConfigPage(querys)
|
||||
if data["total"].(int64) == 0 {
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user