Browse Source

海通国际收藏与申请访谈回显

xingzai 2 years ago
parent
commit
ad23d594d1
2 changed files with 28 additions and 3 deletions
  1. 26 1
      controllers/article.go
  2. 2 2
      controllers/htgj.go

+ 26 - 1
controllers/article.go

@@ -1184,7 +1184,7 @@ func (this *ArticleCommonController) DetailPublic() {
 		return
 	}
 	hasPermission := 0
-
+	uid := wxUser.UserId
 	detail, err := models.GetArticleDetailById(articleId)
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -1302,6 +1302,31 @@ func (this *ArticleCommonController) DetailPublic() {
 			detail.HttpUrl = utils.StrategyPlatform + strconv.Itoa(articleId) + "?token=" + chartUserTokenByMobile
 			detail.IsNeedJump = true
 		}
+		if detail.ArticleId < utils.SummaryArticleId {
+			chartUserTokenByMobile, _ := services.GetUserTokenByMobile(utils.HtgjPublicMobile)
+			detail.HttpUrl = utils.StrategyPlatform + strconv.Itoa(articleId) + "?token=" + chartUserTokenByMobile
+			detail.IsNeedJump = true
+		}
+		collectCount, err := models.GetArticleCollectCount(uid, articleId)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "判断是否已收藏失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
+			return
+		}
+		if collectCount > 0 {
+			detail.IsCollect = true
+		}
+		interviewApplyItem, err := models.GetArticleInterviewApply(uid, articleId)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
+			return
+		}
+		if interviewApplyItem != nil && interviewApplyItem.InterviewApplyId > 0 {
+			detail.IsInterviewApply = true
+			detail.InterviewApplyStatus = interviewApplyItem.Status
+		}
+		resp.Detail = detail
 	}
 	resp.CompanyName = companyName
 	br.Ret = 200

+ 2 - 2
controllers/htgj.go

@@ -935,7 +935,7 @@ func (this *BaseHtgjController) DetailPublic() {
 			}
 		}
 		detail.SellerList = sellerList
-		resp.Detail = detail
+
 		historyRecord := new(models.CygxArticleHistoryRecord)
 		historyRecord.UserId = wxUser.UserId
 		historyRecord.ArticleId = articleId
@@ -997,7 +997,7 @@ func (this *BaseHtgjController) DetailPublic() {
 			detail.IsInterviewApply = true
 			detail.InterviewApplyStatus = interviewApplyItem.Status
 		}
-
+		resp.Detail = detail
 	}
 	resp.CompanyName = companyName
 	br.Ret = 200