|
@@ -96,12 +96,19 @@ func (this *YanxuanSpecialController) List() {
|
|
|
} else {
|
|
|
v.ImgUrlList = []string{}
|
|
|
}
|
|
|
- if v.Tags != "" {
|
|
|
- tagList := strings.Split(v.Tags, ",")
|
|
|
+ if v.CompanyTags != "" {
|
|
|
+ tagList := strings.Split(v.CompanyTags, ",")
|
|
|
for _, s := range tagList {
|
|
|
v.TagList = append(v.TagList, s)
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ if v.IndustryTags != "" {
|
|
|
+ tagList := strings.Split(v.IndustryTags, ",")
|
|
|
+ for _, s := range tagList {
|
|
|
+ v.TagList = append(v.TagList, s)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(v.TagList) == 0 {
|
|
|
v.TagList = []string{}
|
|
|
}
|
|
|
}
|
|
@@ -155,16 +162,16 @@ func (this *YanxuanSpecialController) Detail() {
|
|
|
item.IsCollect = 1
|
|
|
}
|
|
|
|
|
|
- industryTagList, tmpErr := models.GetYanxuanSpecialIndustry("")
|
|
|
- if tmpErr != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- industryTagMap := make(map[string]int, 0)
|
|
|
- for _, v := range industryTagList {
|
|
|
- industryTagMap[v] = 1
|
|
|
- }
|
|
|
+ //industryTagList, tmpErr := models.GetYanxuanSpecialIndustry("")
|
|
|
+ //if tmpErr != nil {
|
|
|
+ // br.Msg = "获取失败"
|
|
|
+ // br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //industryTagMap := make(map[string]int, 0)
|
|
|
+ //for _, v := range industryTagList {
|
|
|
+ // industryTagMap[v] = 1
|
|
|
+ //}
|
|
|
|
|
|
var resp models.CygxYanxuanSpecialResp
|
|
|
resp.CygxYanxuanSpecialItem = *item
|
|
@@ -186,19 +193,22 @@ func (this *YanxuanSpecialController) Detail() {
|
|
|
} else {
|
|
|
resp.ImgUrlList = []string{}
|
|
|
}
|
|
|
- if item.Tags != "" {
|
|
|
- tagList := strings.Split(item.Tags, ",")
|
|
|
- for _, s := range tagList {
|
|
|
- if _,ok := industryTagMap[s]; ok{
|
|
|
- resp.IndustryTags = append(resp.IndustryTags, s)
|
|
|
- } else {
|
|
|
- resp.CompanyTags = append(resp.CompanyTags, s)
|
|
|
- }
|
|
|
+ if item.CompanyTags != "" {
|
|
|
+ cTagList := strings.Split(item.CompanyTags, ",")
|
|
|
+ for _, s := range cTagList {
|
|
|
+ resp.CompanyTags = append(resp.CompanyTags, s)
|
|
|
}
|
|
|
} else {
|
|
|
- resp.IndustryTags = []string{}
|
|
|
resp.CompanyTags = []string{}
|
|
|
}
|
|
|
+ if item.IndustryTags != "" {
|
|
|
+ iTagList := strings.Split(item.IndustryTags, ",")
|
|
|
+ for _, s := range iTagList {
|
|
|
+ resp.IndustryTags = append(resp.IndustryTags, s)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ resp.IndustryTags = []string{}
|
|
|
+ }
|
|
|
|
|
|
go services.AddSpecialRecord(this.User, specialId)
|
|
|
|
|
@@ -319,7 +329,8 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
br.Msg = "请输入内容"
|
|
|
return
|
|
|
}
|
|
|
- if len(req.Tags) > 0 && req.DoType == 2 {
|
|
|
+
|
|
|
+ if len(req.CompanyTags) == 0 && len(req.CompanyTags) == 0 && req.DoType == 2 {
|
|
|
br.Msg = "请至少输入一个标签"
|
|
|
return
|
|
|
}
|
|
@@ -328,19 +339,21 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
return
|
|
|
}
|
|
|
imgUrls := strings.Join(req.ImgUrl, ",")
|
|
|
- tags := strings.Join(req.Tags, ",")
|
|
|
+ cTags := strings.Join(req.CompanyTags, ",")
|
|
|
+ iTags := strings.Join(req.IndustryTags, ",")
|
|
|
item := models.CygxYanxuanSpecial{
|
|
|
- Id: req.Id,
|
|
|
- UserId: sysUser.UserId,
|
|
|
- CreateTime: time.Now(),
|
|
|
- ModifyTime: time.Now(),
|
|
|
- PublishTime: time.Now(),
|
|
|
- Content: req.Content,
|
|
|
- Tags: tags,
|
|
|
- ImgUrl: imgUrls,
|
|
|
- DocUrl: string(docUrl),
|
|
|
- Title: req.Title,
|
|
|
- Type: req.Type,
|
|
|
+ Id: req.Id,
|
|
|
+ UserId: sysUser.UserId,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ ModifyTime: time.Now(),
|
|
|
+ PublishTime: time.Now(),
|
|
|
+ Content: req.Content,
|
|
|
+ CompanyTags: cTags,
|
|
|
+ IndustryTags: iTags,
|
|
|
+ ImgUrl: imgUrls,
|
|
|
+ DocUrl: string(docUrl),
|
|
|
+ Title: req.Title,
|
|
|
+ Type: req.Type,
|
|
|
}
|
|
|
if req.DoType == 1 {
|
|
|
item.Status = 1
|