xingzai 2 rokov pred
rodič
commit
fce258012f
2 zmenil súbory, kde vykonal 11 pridanie a 13 odobranie
  1. 2 5
      controllers/article.go
  2. 9 8
      models/article.go

+ 2 - 5
controllers/article.go

@@ -65,7 +65,6 @@ func (this *ArticleController) Detail() {
 	}
 	detail := new(models.ArticleDetail)
 	hasPermission := 0
-	hasFree := 0
 	var haveResearch bool
 	//判断是否已经申请过
 	applyCount, err := models.GetApplyRecordCount(uid)
@@ -90,6 +89,7 @@ func (this *ArticleController) Detail() {
 			br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
 			return
 		}
+		resp.IsSpecialArticle = true
 		if !havePower {
 			hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
 			if err != nil {
@@ -139,10 +139,9 @@ func (this *ArticleController) Detail() {
 			} else {
 				hasPermission = 2
 			}
-			hasFree = 2
+
 			goto Loop
 		} else {
-			hasFree = 1
 			var articlePermissionPermissionName string
 			if detail.CategoryId > 0 {
 				articlePermission, err := models.GetArticlePermission(detail.CategoryId)
@@ -404,10 +403,8 @@ Loop:
 			detail.ReportLink += "?token=" + chartUserTokenByMobile
 		}
 	}
-
 	resp.HasPermission = hasPermission
 	resp.HaveResearch = haveResearch
-	resp.HasFree = hasFree
 	resp.Detail = detail
 	if user.Mobile != "" {
 		resp.Mobile = user.Mobile

+ 9 - 8
models/article.go

@@ -216,14 +216,15 @@ func GetArticlePermission(companyId int) (item *ChartPermission, err error) {
 }
 
 type ArticleDetailResp struct {
-	Detail        *ArticleDetail
-	HasPermission int    `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
-	HasFree       int    `description:"1:已付费(至少包含一个品类的权限),2:未付费(没有任何品类权限)"`
-	HaveResearch  bool   `description:"是否有研选权限"`
-	Mobile        string `description:"用户手机号"`
-	PopupMsg      string `description:"权限弹窗信息"`
-	SellerMobile  string `description:"销售电话"`
-	SellerName    string `description:"销售姓名"`
+	Detail           *ArticleDetail
+	HasPermission    int    `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
+	HasFree          int    `description:"1:已付费(至少包含一个品类的权限),2:未付费(没有任何品类权限)"`
+	HaveResearch     bool   `description:"是否有研选权限"`
+	Mobile           string `description:"用户手机号"`
+	PopupMsg         string `description:"权限弹窗信息"`
+	SellerMobile     string `description:"销售电话"`
+	SellerName       string `description:"销售姓名"`
+	IsSpecialArticle bool   `description:"是否属于专项调研报告"`
 }
 
 type ArticleDetailHtgjResp struct {