Browse Source

报告去掉时分秒字段

xingzai 2 years ago
parent
commit
1f8a4caf98
3 changed files with 7 additions and 3 deletions
  1. 5 3
      controllers/article.go
  2. 1 0
      controllers/search.go
  3. 1 0
      models/article.go

+ 5 - 3
controllers/article.go

@@ -88,6 +88,11 @@ func (this *ArticleController) Detail() {
 			br.ErrMsg = "获取信息失败,Err:" + err.Error()
 			return
 		}
+		//是否属于专项调研报告
+		if detail.SubCategoryName == "专项调研" {
+			detail.IsSpecialArticle = true
+		}
+		detail.PublishDate = utils.TimeRemoveHms(detail.PublishDate)
 		detail.Body = html.UnescapeString(detail.Body)
 		detail.Body = strings.Replace(detail.Body, "<p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;\">Powered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>", "", -1)
 		detail.Body = strings.Replace(detail.Body, "pre", "div", -1)
@@ -140,16 +145,13 @@ func (this *ArticleController) Detail() {
 			if userType == 1 && strings.Contains(detail.CategoryName, "研选") {
 				hasPersion = false
 			}
-
 			if detail.IsReport == 1 {
-				fmt.Println("报告权限")
 				detailCategory, err := models.GetdetailByCategoryIdSando(detail.CategoryId)
 				if err != nil && err.Error() != utils.ErrNoRow() {
 					br.Msg = "获取信息失败"
 					br.ErrMsg = "获取信息失败,Err:" + err.Error() + "categoryID 不存在:" + strconv.Itoa(detail.CategoryId)
 					return
 				}
-				fmt.Println(detailCategory)
 				permissionStr, err := models.GetCompanyPermissionByUser(user.CompanyId)
 				if err != nil {
 					br.Msg = "获取信息失败"

+ 1 - 0
controllers/search.go

@@ -620,6 +620,7 @@ func (this *SearchController) ListHomeArtAndChartPage() {
 				result[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
 			}
 			result[k].Source = 1
+			v.PublishDate = utils.TimeRemoveHms(v.PublishDate)
 		}
 	}
 	//记录用户搜索关键词

+ 1 - 0
models/article.go

@@ -152,6 +152,7 @@ type ArticleDetail struct {
 	ReportLink              string `description:"报告链接"`
 	IsShowLinkButton        int    `description:"这种报告类型是否展示查看报告链接"`
 	ArticleTypeId           int    `description:"文章类型ID"`
+	IsSpecialArticle        bool   `description:"是否属于专项调研报告"`
 }
 
 type ArticleDetailFileLink struct {