xingzai 1 vuosi sitten
vanhempi
commit
6e4e095348
1 muutettua tiedostoa jossa 11 lisäystä ja 39 poistoa
  1. 11 39
      controllers/yanxuan_special.go

+ 11 - 39
controllers/yanxuan_special.go

@@ -233,7 +233,7 @@ func (this *BaseAuthMobileController) Detail() {
 		resp.ContentHasStyle = true
 	}
 
-	var hasPermission int
+	//var hasPermission int
 	//if userId > 0 {
 	//	hasPermission, err = services.GetUserYxHasPermissionCode(user)
 	//	if err != nil {
@@ -242,48 +242,20 @@ func (this *BaseAuthMobileController) Detail() {
 	//	}
 	//}
 
-	//if userId == 0 {
-	//	hasPermission = 1
-	//	resp.Content = utils.InterceptHtmlLength(resp.Content, 240) // 截取前80个字
+	//resp.HasPermission = hasPermission
+
+	//如果是用户本人写的专栏,那么就不做校验
+	//if item.UserId == user.UserId || user.UserId == 0 {
+	//	resp.HasPermission = 1
 	//} else {
-	//	//查询研选的权限状态
-	//	var condition string
-	//	var pars []interface{}
-	//	condition = " AND company_id = ?  AND status  IN ('正式','试用')  AND chart_permission_id = ?   ORDER BY company_report_permission_id DESC LIMIT 1  "
-	//	pars = append(pars, user.CompanyId, utils.CHART_PERMISSION_ID_YANXUAN)
-	//	companyReportPermissionDetail, err := models.GetCompanyReportPermissionDetailByCondition(condition, pars)
-	//	if err != nil && err.Error() != utils.ErrNoRow() {
-	//		br.Msg = "获取信息失败"
-	//		br.ErrMsg = "获取用户所在公司剩余的点失败,Err:" + err.Error()
+	//	hasPermission, err = services.GetUserRaiPermissionYanXuanInfo(user)
+	//	if err != nil {
+	//		br.Msg = "获取失败"
+	//		br.ErrMsg = "获取失败, Err:" + err.Error()
 	//		return
 	//	}
-	//	if companyReportPermissionDetail == nil {
-	//		hasPermission, _, _, _, err = services.GetUserHasPermissionArticle(user)
-	//		if err != nil {
-	//			br.Msg = "获取信息失败"
-	//			br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-	//			return
-	//		}
-	//	} else {
-	//		hasPermission = 1
-	//	}
-	//
+	//	resp.HasPermission = hasPermission
 	//}
-	//
-	//resp.HasPermission = hasPermission
-
-	//如果是用户本人写的专栏,那么就不做校验
-	if item.UserId == user.UserId || user.UserId == 0 {
-		resp.HasPermission = 1
-	} else {
-		hasPermission, err = services.GetUserRaiPermissionYanXuanInfo(user)
-		if err != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "获取失败, Err:" + err.Error()
-			return
-		}
-		resp.HasPermission = hasPermission
-	}
 
 	br.Data = resp
 	br.Ret = 200