|
@@ -74,24 +74,55 @@ func (this *ArticleController) Detail() {
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- //`description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,4:潜在客户,未提交过申请,5:潜在客户,已提交过申请"`
|
|
|
- if user.CompanyId > 1 {
|
|
|
- companyPermission, err := models.GetCompanyPermission(user.CompanyId)
|
|
|
+ resp := new(models.ArticleDetailResp)
|
|
|
+ detail, err = models.GetArticleDetailById(articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //是否属于专项调研报告
|
|
|
+ if detail.SubCategoryName == "专项调研" {
|
|
|
+ detail.IsSpecialArticle = true
|
|
|
+ havePower, err := services.GetSpecialArticleDetailUserPower(user, detail)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
+ br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- detail, err = models.GetArticleDetailById(articleId)
|
|
|
+ if !havePower {
|
|
|
+ hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.PopupMsg = popupMsg
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
+ resp.SellerName = sellerName
|
|
|
+ resp.SellerMobile = sellerMobile
|
|
|
+ detail.Body = ""
|
|
|
+ detail.Abstract = ""
|
|
|
+ detail.BodyText = ""
|
|
|
+ detail.SellerName = sellerName
|
|
|
+ detail.SellerMobile = sellerMobile
|
|
|
+ resp.Detail = detail
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //`description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,4:潜在客户,未提交过申请,5:潜在客户,已提交过申请"`
|
|
|
+ if user.CompanyId > 1 {
|
|
|
+ companyPermission, err := models.GetCompanyPermission(user.CompanyId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
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)
|
|
@@ -363,22 +394,13 @@ Loop:
|
|
|
|
|
|
// 处理研选下面的路演精华 的报告链接是否跳转
|
|
|
if hasPermission == 1 && detail.ArticleId > utils.SummaryArticleId && detail.ArticleTypeId > 0 {
|
|
|
- //articleTYpeDetail, err := models.GetArticleTypeInfo(detail.ArticleTypeId)
|
|
|
- //if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- // br.Msg = "获取信息失败"
|
|
|
- // br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
- // return
|
|
|
- //}
|
|
|
- //if articleTYpeDetail != nil {
|
|
|
- // detail.IsShowLinkButton = articleTYpeDetail.IsShowLinkButton
|
|
|
- //}
|
|
|
detail.PublishDate = utils.TimeRemoveHms2(detail.PublishDate)
|
|
|
if detail.ReportLink != "" {
|
|
|
chartUserTokenByMobile, _ := services.GetUserTokenByMobile(user.Mobile)
|
|
|
detail.ReportLink += "?token=" + chartUserTokenByMobile
|
|
|
}
|
|
|
}
|
|
|
- resp := new(models.ArticleDetailResp)
|
|
|
+
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.HaveResearch = haveResearch
|
|
|
resp.HasFree = hasFree
|