Browse Source

no message

xingzai 1 year ago
parent
commit
7da429594b
3 changed files with 21 additions and 2 deletions
  1. 18 1
      controllers/article.go
  2. 2 0
      models/article.go
  3. 1 1
      services/activity.go

+ 18 - 1
controllers/article.go

@@ -66,6 +66,7 @@ func (this *ArticleController) Detail() {
 		return
 	}
 	detail := new(models.ArticleDetail)
+	//detailInit := new(models.ArticleDetail) // 初始化的文章信息,用来处理body 内容回显
 	hasPermission := 0
 	var haveResearch bool
 	//判断是否已经申请过
@@ -82,6 +83,7 @@ func (this *ArticleController) Detail() {
 		br.ErrMsg = "获取信息失败,Err:" + err.Error()
 		return
 	}
+
 	lyjhTypeMap, _ := services.GetLyjhTypeMap()
 	if _, ok := lyjhTypeMap[detail.CategoryId]; ok {
 		detail.IsRoadShow = true
@@ -117,6 +119,7 @@ func (this *ArticleController) Detail() {
 	}
 	articleCollectMap, _ := services.GetCygxArticleCollectMap(user.UserId)
 	detail.IsCollect = articleCollectMap[detail.ArticleId]
+	//detailInit = detail
 	if isSendWx == 1 {
 		var condition string
 		var pars []interface{}
@@ -201,6 +204,7 @@ func (this *ArticleController) Detail() {
 		detail.Body = strings.Replace(detail.Body, "pre", "div", -1)
 		//detail.Abstract = html.UnescapeString(detail.Abstract)
 		detail.Abstract, _ = services.GetReportContentTextSubNew(detail.Abstract)
+
 		if companyPermission == "" {
 			if applyCount > 0 {
 				hasPermission = 5
@@ -350,7 +354,7 @@ func (this *ArticleController) Detail() {
 		}
 	}
 Loop:
-	if hasPermission != 1 {
+	if hasPermission != 1 && user.UserId > 0 {
 		detail.Body = ""
 		detail.BodyText = ""
 	} else {
@@ -433,6 +437,19 @@ Loop:
 	}
 	resp.HasPermission = hasPermission
 	resp.HaveResearch = haveResearch
+	if user.UserId == 0 {
+		if detail.UpdateFrequency == "daily" {
+			detail.Frequency = "日度"
+		} else if detail.UpdateFrequency == "weekly" {
+			detail.Frequency = "周度"
+		} else if detail.UpdateFrequency == "monthly" {
+			detail.Frequency = "月度"
+		} else if detail.UpdateFrequency == "quarterly" {
+			detail.Frequency = "季度"
+		} else if detail.UpdateFrequency == "yearly" {
+			detail.Frequency = "年度"
+		}
+	}
 	resp.Detail = detail
 	if user.Mobile != "" {
 		resp.Mobile = user.Mobile

+ 2 - 0
models/article.go

@@ -181,6 +181,8 @@ type ArticleDetail struct {
 	IsApplyAppointmentExpert bool   `description:"是否属于专家访谈"`
 	ArticleTypeName          string `description:"权限名称"`
 	MatchTypeName            string `description:"匹配类型"`
+	Stock                    string `description:"个股标签"`
+	Frequency                string `description:"更新周期(策略平台字段)"`
 }
 
 type ArticleDetailFileLink struct {

+ 1 - 1
services/activity.go

@@ -1182,7 +1182,7 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 func ActivityConditioninitSql(user *models.WxUserItem, condition string, isPower int) (conditionActivity string, err error) {
 	//未登录的用户也可以查看所有活动v12.2.1
 	if user.UserId == 0 {
-		conditionActivity = ` AND art.publish_status = 1  `
+		conditionActivity = ` AND art.publish_status = 1   AND art.yidong_activity_id = ''  ` + condition
 		return
 	}
 	// cygx_10.9 未绑定联系方式的客户可以看到部分活动