xingzai 10 meses atrás
pai
commit
45f074a315
1 arquivos alterados com 12 adições e 11 exclusões
  1. 12 11
      controllers/yanxuan_special.go

+ 12 - 11
controllers/yanxuan_special.go

@@ -186,6 +186,18 @@ func (this *BaseAuthMobileController) Detail() {
 	if item.MyCollectNum > 0 {
 		item.IsCollect = 1
 	}
+	//是否点赞
+	total, err := models.GetCygxYanxuanSpecialSpecialLikeCountByUidYid(user.UserId, specialId)
+	if err != nil {
+		br.Msg = "操作失败!"
+		br.ErrMsg = "操作失败,Err:" + err.Error()
+		return
+	}
+
+	if total > 0 {
+		item.IsLikeCount = true
+	}
+
 	//记录分享来源
 	if inviteShareCode != "" {
 		go services.AddCygxUserAdminShareHistory(user, utils.CYGX_OBJ_YANXUANSPECIAL, item.Title, inviteShareCode, specialId)
@@ -268,17 +280,6 @@ func (this *BaseAuthMobileController) Detail() {
 	}
 	resp.HasPermission = hasPermission
 
-	//是否点赞
-	total, err := models.GetCygxYanxuanSpecialSpecialLikeCountByUidYid(user.UserId, specialId)
-	if err != nil {
-		br.Msg = "操作失败!"
-		br.ErrMsg = "操作失败,Err:" + err.Error()
-		return
-	}
-	if total > 0 {
-		item.IsLikeCount = true
-	}
-
 	//支付信息
 	resp.IsShowWxPay = utils.IS_SHOW_WX_PAY                                                      //是否展示微信支付按钮
 	resp.IsCompanyApply = services.GetUserApplyRecordCountByCompanyIdPay(user.CompanyId)         //获取客户是否有过历史申请记录