Эх сурвалжийг харах

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

xingzai 2 жил өмнө
parent
commit
18cb19e356
1 өөрчлөгдсөн 21 нэмэгдсэн , 1 устгасан
  1. 21 1
      controllers/htgj.go

+ 21 - 1
controllers/htgj.go

@@ -860,7 +860,7 @@ func (this *BaseHtgjController) DetailPublic() {
 		return
 	}
 	hasPermission := 0
-
+	uid := wxUser.UserId
 	detail, err := models.GetArticleDetailById(articleId)
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -978,6 +978,26 @@ func (this *BaseHtgjController) DetailPublic() {
 			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.CompanyName = companyName
 	br.Ret = 200