xingzai hai 1 ano
pai
achega
15af07580e
Modificáronse 2 ficheiros con 20 adicións e 8 borrados
  1. 8 8
      controllers/activity.go
  2. 12 0
      services/company_permission.go

+ 8 - 8
controllers/activity.go

@@ -892,16 +892,16 @@ func (this *ActivityNoLoginController) Detail() {
 	}
 
 	if uid == 0 {
-		detailResp := services.ActivityButtonShow(activityInfo, user, make([]string, 0))
-		detailResp, err = services.ActivityDetaailShow(detailResp)
-		if err != nil {
-			br.Msg = "获取信息失败"
-			br.ErrMsg = "ActivityDetaailShow Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
-			return
-		}
-		resp.Detail = detailResp
 		resp.HasPermission = 1
 	}
+	detailResp := services.ActivityButtonShow(activityInfo, user, make([]string, 0))
+	detailResp, err = services.ActivityDetaailShow(detailResp)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "ActivityDetaailShow Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
+		return
+	}
+	resp.Detail = detailResp
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 12 - 0
services/company_permission.go

@@ -72,6 +72,12 @@ func GetUserHasPermission(user *models.WxUserItem) (hasPermission int, sellerNam
 			hasPermission = 2
 		}
 	}
+
+	hasPermission, e = GetUserPermissionCode(user.UserId, user.CompanyId)
+	if e != nil {
+		err = errors.New("GetUserDetailPermissionCode, Err: " + e.Error())
+		return
+	}
 	popupMsg = "需要升级行业套餐权限才可参与此活动,请联系对口销售"
 	return
 }
@@ -117,6 +123,12 @@ func GetUserHasPermissionArticle(user *models.WxUserItem) (hasPermission int, se
 			hasPermission = 2
 		}
 	}
+
+	hasPermission, e = GetUserPermissionCode(user.UserId, user.CompanyId)
+	if e != nil {
+		err = errors.New("GetUserDetailPermissionCode, Err: " + e.Error())
+		return
+	}
 	popupMsg = "需要升级行业套餐权限才可查看此报告,请联系对口销售"
 	return
 }