Răsfoiți Sursa

专项调研详情状态码

xingzai 2 ani în urmă
părinte
comite
49f6a58482

+ 1 - 3
controllers/activity_special.go

@@ -95,7 +95,6 @@ func (this *ActivitySpecialCoAntroller) SpecialDetail() {
 		return
 	}
 	resp := new(models.CygxActivitySpecialResp)
-	hasPermission := 0
 	activityInfo, err := models.GetCygxActivitySpecialDetailById(uid, activityId)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取信息失败"
@@ -113,6 +112,7 @@ func (this *ActivitySpecialCoAntroller) SpecialDetail() {
 		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
 		return
 	}
+	//判断有没有对应的权限,如果没有则给出对应的状态码
 	if havePower {
 		resp.HasPermission = 1
 		count, err := models.GetCygxUserFollowSpecial(user.UserId)
@@ -158,8 +158,6 @@ func (this *ActivitySpecialCoAntroller) SpecialDetail() {
 		resp.SellerName = sellerName
 		resp.SellerMobile = sellerMobile
 	}
-	//判断是否已经申请过
-	resp.HasPermission = hasPermission
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 2 - 1
services/activity_special.go

@@ -624,7 +624,7 @@ func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.Cyg
 	var userTypes string
 	condition += `  AND art.publish_status = 1 AND art.is_offline = 0   `
 	userTypes = "%" + strconv.Itoa(userType) + "%"
-	condition += ` AND art.research_theme LIKE ? `
+	condition += ` AND art.customer_type_ids LIKE ? `
 	pars = append(pars, userTypes)
 
 	condition += ` AND art.activity_id = ? `
@@ -638,6 +638,7 @@ func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.Cyg
 	if total == 1 {
 		havePower = true
 	}
+	fmt.Println(havePower)
 	fmt.Println(permissionStr)
 	fmt.Println(userType)
 	return

+ 4 - 1
services/company_permission.go

@@ -2,6 +2,7 @@ package services
 
 import (
 	"errors"
+	"fmt"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
 	"strings"
@@ -60,15 +61,17 @@ func GetUserHasPermission(user *models.WxUserItem) (hasPermission int, sellerNam
 					err = errors.New("GetSellerByCompanyIdCheckFicc, Err: " + e.Error())
 					return
 				}
+				fmt.Println(sellerItemQy)
 				if sellerItemQy != nil {
 					hasPermission = 2
 					sellerName = sellerItemQy.Mobile
 					sellerMobile = sellerItemQy.RealName
 				} else {
-					hasPermission = 3
+					hasPermission = 5
 				}
 			}
 		}
 	}
+	fmt.Println(hasPermission)
 	return
 }