|
@@ -9,6 +9,7 @@ import (
|
|
|
"hongze/hongze_cygx/services"
|
|
|
"hongze/hongze_cygx/utils"
|
|
|
"os"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -80,13 +81,22 @@ func (this *YanxuanSpecialController) List() {
|
|
|
v.Docs = docs
|
|
|
}
|
|
|
if v.Type == 1 {
|
|
|
- v.Title = "【笔记】"+v.Title
|
|
|
+ v.Title = "【笔记】" + v.Title
|
|
|
} else if v.Type == 2 {
|
|
|
- v.Title = "【观点】"+v.Title
|
|
|
+ v.Title = "【观点】" + v.Title
|
|
|
}
|
|
|
if v.MyCollectNum > 0 {
|
|
|
v.IsCollect = 1
|
|
|
}
|
|
|
+ if v.CompanyTags != "" {
|
|
|
+ v.Tags += v.CompanyTags
|
|
|
+ }
|
|
|
+ if v.IndustryTags != "" {
|
|
|
+ if v.Tags != "" {
|
|
|
+ v.Tags += ","
|
|
|
+ }
|
|
|
+ v.Tags += v.IndustryTags
|
|
|
+ }
|
|
|
}
|
|
|
resp := new(models.SpecialListResp)
|
|
|
|
|
@@ -150,6 +160,22 @@ func (this *YanxuanSpecialController) Detail() {
|
|
|
}
|
|
|
resp.Docs = docs
|
|
|
}
|
|
|
+ if item.CompanyTags != "" {
|
|
|
+ cTagList := strings.Split(item.CompanyTags, ",")
|
|
|
+ for _, s := range cTagList {
|
|
|
+ resp.CompanyTags = append(resp.CompanyTags, s)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ 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)
|
|
|
|
|
@@ -269,7 +295,7 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
br.Msg = "请输入内容"
|
|
|
return
|
|
|
}
|
|
|
- if req.Tags == "" && req.DoType == 2 {
|
|
|
+ if req.CompanyTags == "" && req.IndustryTags == "" && req.DoType == 2 {
|
|
|
br.Msg = "请至少输入一个标签"
|
|
|
return
|
|
|
}
|
|
@@ -286,11 +312,14 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
DocUrl: req.DocUrl,
|
|
|
Title: req.Title,
|
|
|
Type: req.Type,
|
|
|
+ CompanyTags: req.CompanyTags,
|
|
|
+ IndustryTags: req.IndustryTags,
|
|
|
}
|
|
|
if req.DoType == 1 {
|
|
|
item.Status = 1
|
|
|
} else {
|
|
|
item.Status = 2
|
|
|
+ //todo
|
|
|
}
|
|
|
|
|
|
if req.Id == 0 {
|
|
@@ -872,8 +901,8 @@ func (this *YanxuanSpecialController) AuthorHeadImg() {
|
|
|
}
|
|
|
|
|
|
item := models.CygxYanxuanSpecialAuthor{
|
|
|
- UserId: req.UserId,
|
|
|
- HeadImg: req.HeadImg,
|
|
|
+ UserId: req.UserId,
|
|
|
+ HeadImg: req.HeadImg,
|
|
|
}
|
|
|
|
|
|
err = models.UpdateYanxuanSpecialAuthorHeadImg(&item)
|
|
@@ -971,7 +1000,7 @@ func (this *YanxuanSpecialController) Check() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- suggest := models.WxCheckContent(itemToken.AccessToken,sysUser.OpenId, req.Content)
|
|
|
+ suggest := models.WxCheckContent(itemToken.AccessToken, sysUser.OpenId, req.Content)
|
|
|
if suggest == "risky" {
|
|
|
br.Msg = "文章内容含有违法违规内容"
|
|
|
br.ErrMsg = "文章内容含有违法违规内容"
|
|
@@ -1000,7 +1029,7 @@ func (this *YanxuanSpecialController) Check() {
|
|
|
br.ErrMsg = "图片内容含有违法违规内容"
|
|
|
return
|
|
|
}
|
|
|
- if err := res.GetResponseError(); err !=nil {
|
|
|
+ if err := res.GetResponseError(); err != nil {
|
|
|
// 处理微信返回错误信息
|
|
|
return
|
|
|
}
|
|
@@ -1014,4 +1043,4 @@ func (this *YanxuanSpecialController) Check() {
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "校验成功"
|
|
|
-}
|
|
|
+}
|