xingzai 2 éve
szülő
commit
ba477f452a
4 módosított fájl, 36 hozzáadás és 0 törlés
  1. 22 0
      controllers/activity.go
  2. 12 0
      controllers/article.go
  3. 1 0
      models/activity.go
  4. 1 0
      models/article.go

+ 22 - 0
controllers/activity.go

@@ -576,6 +576,12 @@ func (this *ActivityCoAntroller) Detail() {
 		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
 		return
 	}
+	detailConfig, err := models.GetConfigByCode("free_trial_card")
+	if err != nil {
+		br.Msg = "获取数据失败"
+		br.ErrMsg = "城市配置信息失败,Err:" + err.Error()
+		return
+	}
 
 	//获取FICC销售信息 如果是FICC的客户类型,则默认他申请过
 	sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
@@ -616,6 +622,12 @@ func (this *ActivityCoAntroller) Detail() {
 					}
 				}
 			}
+
+			if detailConfig.ConfigValue == "1" {
+				if hasPermission == 3 {
+					resp.IsShow = true
+				}
+			}
 			resp.HasPermission = hasPermission
 			resp.OperationMode = "Apply"
 			resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
@@ -717,6 +729,11 @@ func (this *ActivityCoAntroller) Detail() {
 						}
 					}
 				}
+				if detailConfig.ConfigValue == "1" {
+					if hasPermission == 3 {
+						resp.IsShow = true
+					}
+				}
 				resp.HasPermission = hasPermission
 				resp.OperationMode = "Apply"
 				resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
@@ -795,6 +812,11 @@ func (this *ActivityCoAntroller) Detail() {
 		resp.Detail = activityInfo
 	}
 	resp.HasPermission = hasPermission
+	if detailConfig.ConfigValue == "1" {
+		if hasPermission == 3 {
+			resp.IsShow = true
+		}
+	}
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 12 - 0
controllers/article.go

@@ -323,7 +323,19 @@ Loop:
 		detail.HttpUrl = utils.StrategyPlatform + strconv.Itoa(articleId)
 		detail.IsNeedJump = true
 	}
+
 	resp := new(models.ArticleDetailResp)
+	detailConfig, err := models.GetConfigByCode("free_trial_card")
+	if err != nil {
+		br.Msg = "获取数据失败"
+		br.ErrMsg = "城市配置信息失败,Err:" + err.Error()
+		return
+	}
+	if detailConfig.ConfigValue == "1" {
+		if hasPermission == 5 {
+			resp.IsShow = true
+		}
+	}
 	resp.HasPermission = hasPermission
 	resp.HaveResearch = haveResearch
 	resp.HasFree = hasFree

+ 1 - 0
models/activity.go

@@ -107,6 +107,7 @@ type CygxActivityResp struct {
 	SellerMobile      string `description:"销售电话"`
 	SellerName        string `description:"销售姓名"`
 	Detail            *ActivityDetail
+	IsShow            bool `description:"是否展示"`
 }
 
 //通过纪要ID获取活动详情

+ 1 - 0
models/article.go

@@ -224,6 +224,7 @@ type ArticleDetailResp struct {
 	HasFree       int    `description:"1:已付费(至少包含一个品类的权限),2:未付费(没有任何品类权限)"`
 	HaveResearch  bool   `description:"是否有研选权限"`
 	Mobile        string `description:"用户手机号"`
+	IsShow        bool   `description:"是否展示"`
 }
 
 func ModifyArticleExpert(articleId int, expertNumStr, expertContentStr, interviewDateStr, bodyText string) (err error) {