Browse Source

no message

xingzai 1 year ago
parent
commit
57b221c1aa
2 changed files with 19 additions and 4 deletions
  1. 15 3
      controllers/tag.go
  2. 4 1
      models/cygx_tag.go

+ 15 - 3
controllers/tag.go

@@ -10,7 +10,6 @@ type TagController struct {
 	BaseAuthController
 }
 
-
 // @Title 获取标签列表-自定义顺序
 // @Description 获取标签列表-自定义顺序接口
 // @Success 200 {object} cygx.ChartPermissionResp
@@ -47,8 +46,21 @@ func (this *TagController) TagCustomizeList() {
 		return
 	}
 
-
 	list, err := models.GetCygxTagList(condition)
+	for _, v := range list {
+		if v.ArticleTypes != "" {
+			v.Atag = true
+		}
+		if v.ActivityTypes != "" {
+			v.Btag = true
+		}
+		if v.Industries != "" {
+			v.Ctag = true
+		}
+		if v.SubjectNames != "" {
+			v.Dtag = true
+		}
+	}
 	if err != nil {
 		br.Msg = "获取标签失败"
 		br.ErrMsg = "获取标签信息失败,Err:" + err.Error()
@@ -96,4 +108,4 @@ func (this *TagController) History() {
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "记录成功"
-}
+}

+ 4 - 1
models/cygx_tag.go

@@ -46,9 +46,12 @@ type CygxTagList struct {
 	OnlineTime    string `orm:"column(online_time)"`             // 上线时间
 	OfflineTime   string `orm:"column(offline_time)"`            // 下线时间
 	Status        int    `orm:"column(status);NOT NULL"`         // 状态:0-禁用 1-启用
+	Atag          bool   // A标签是否有值
+	Btag          bool   // A标签是否有值
+	Ctag          bool   // A标签是否有值
+	Dtag          bool   // A标签是否有值
 }
 
-
 // 获取tag列表
 func GetCygxTagList(cond string) (items []*CygxTagList, err error) {
 	o := orm.NewOrm()