소스 검색

no message

xingzai 3 년 전
부모
커밋
3ca57d5e5d
3개의 변경된 파일58개의 추가작업 그리고 33개의 파일을 삭제
  1. 48 31
      controllers/activity.go
  2. 8 1
      controllers/article.go
  3. 2 1
      models/company.go

+ 48 - 31
controllers/activity.go

@@ -748,10 +748,15 @@ func (this *ActivityCoAntroller) Detail() {
 				resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
 				resp.MsgType = "Industry"
 			}
-			resp.SellerMobile = companyItem.Mobile
-			resp.SellerName = companyItem.SellerName
-			resp.OperationMode = "Call"
-			hasPermission = 2
+			if companyItem.ProductId == 2 {
+				resp.SellerMobile = companyItem.Mobile
+				resp.SellerName = companyItem.SellerName
+				resp.OperationMode = "Call"
+				hasPermission = 2
+			} else {
+				hasPermission = 5
+			}
+
 		}
 	} else { //潜在客户
 		if applyCount > 0 {
@@ -1160,17 +1165,21 @@ func (this *ActivityCoAntroller) SignupAdd() {
 				resp.HaqveJurisdiction = true
 			}
 		} else {
-			hasPermission = 2
-			resp.SellerMobile = companyItem.Mobile
-			resp.SellerName = companyItem.SellerName
-			resp.MsgType = "Type"
-			resp.OperationMode = "Call"
-			if permissionStr == "专家" {
-				resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+			if companyItem.ProductId == 2 {
+				hasPermission = 2
+				resp.SellerMobile = companyItem.Mobile
+				resp.SellerName = companyItem.SellerName
 				resp.MsgType = "Type"
+				resp.OperationMode = "Call"
+				if permissionStr == "专家" {
+					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+					resp.MsgType = "Type"
+				} else {
+					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+					resp.MsgType = "Industry"
+				}
 			} else {
-				resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-				resp.MsgType = "Industry"
+				hasPermission = 5
 			}
 		}
 	} else { //潜在客户
@@ -1639,17 +1648,21 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
 			}
 			resp.HaqveJurisdiction = true
 		} else {
-			hasPermission = 2
-			resp.SellerMobile = companyItem.Mobile
-			resp.SellerName = companyItem.SellerName
-			resp.MsgType = "Type"
-			resp.OperationMode = "Call"
-			if permissionStr == "专家" {
-				resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+			if companyItem.ProductId == 2 {
+				hasPermission = 2
+				resp.SellerMobile = companyItem.Mobile
+				resp.SellerName = companyItem.SellerName
 				resp.MsgType = "Type"
+				resp.OperationMode = "Call"
+				if permissionStr == "专家" {
+					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+					resp.MsgType = "Type"
+				} else {
+					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+					resp.MsgType = "Industry"
+				}
 			} else {
-				resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-				resp.MsgType = "Industry"
+				hasPermission = 5
 			}
 		}
 	} else { //潜在客户
@@ -2974,17 +2987,21 @@ func (this *ActivityCoAntroller) CheckAsk() {
 			signupStatus = "Success"
 			resp.HaqveJurisdiction = true
 		} else {
-			hasPermission = 2
-			resp.SellerMobile = companyItem.Mobile
-			resp.SellerName = companyItem.SellerName
-			resp.MsgType = "Type"
-			resp.OperationMode = "Call"
-			if permissionStr == "专家" {
-				resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+			if companyItem.ProductId == 2 {
+				hasPermission = 2
+				resp.SellerMobile = companyItem.Mobile
+				resp.SellerName = companyItem.SellerName
 				resp.MsgType = "Type"
+				resp.OperationMode = "Call"
+				if permissionStr == "专家" {
+					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+					resp.MsgType = "Type"
+				} else {
+					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+					resp.MsgType = "Industry"
+				}
 			} else {
-				resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-				resp.MsgType = "Industry"
+				hasPermission = 5
 			}
 		}
 	} else { //潜在客户

+ 8 - 1
controllers/article.go

@@ -191,7 +191,13 @@ func (this *ArticleController) Detail() {
 					}
 				}
 			} else { //无该行业权限
-				hasPermission = 3
+				companyDetail, err := models.GetCompanyDetailById(user.CompanyId)
+				if err == nil && companyDetail.ProductId == 1 {
+					hasPermission = 4
+				} else {
+					fmt.Println("这里", hasPermission)
+					hasPermission = 3
+				}
 			}
 			if hasPermission == 1 {
 				key := "CYGX_ARTICLE_" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid)
@@ -293,6 +299,7 @@ Loop:
 		haveResearch = true
 	}
 
+	fmt.Println("hasPermission", hasPermission)
 	if hasPermission == 2 || hasPermission == 4 {
 		//获取销售手机号
 		sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)

+ 2 - 1
models/company.go

@@ -9,6 +9,7 @@ type CompanyDetail struct {
 	SellerId    int    `description:"销售id"`
 	SellerName  string `description:"销售名称"`
 	Mobile      string `description:"销售手机号"`
+	ProductId   int    `description:"1,FICC,2权益"`
 }
 
 func GetCompanyDetailById(companyId int) (item *CompanyDetail, err error) {
@@ -18,7 +19,7 @@ func GetCompanyDetailById(companyId int) (item *CompanyDetail, err error) {
 	//		LEFT JOIN admin AS c ON b.seller_id=c.admin_id
 	//		WHERE a.company_id=? AND  b.product_id=2 `
 
-	sql := ` SELECT a.company_id,a.company_name,b.status,b.seller_id,b.seller_name,c.mobile 
+	sql := ` SELECT a.company_id,a.company_name,b.status,b.seller_id,b.seller_name,c.mobile,p.product_id
             FROM company AS a
 			INNER JOIN company_product AS b ON a.company_id=b.company_id
 			INNER JOIN company_report_permission AS p ON p.company_id = a.company_id