zwxi 11 months ago
parent
commit
3ab38369a0
1 changed files with 11 additions and 4 deletions
  1. 11 4
      controllers/roadshow/calendar.go

+ 11 - 4
controllers/roadshow/calendar.go

@@ -621,7 +621,11 @@ func (this *CalendarController) Refuse() {
 func (this *CalendarController) CalendarDetail() {
 	//adminItem:=this.AdminWx
 	//roleTypeCode := adminItem.RoleTypeCode
-
+	sysUser := this.AdminWx
+	if sysUser == nil {
+		this.FailWithMessage("请登录", "请登录,SysUser Is Empty")
+		return
+	}
 	rsCalendarId, _ := this.GetInt("RsCalendarId")
 	rsCalendarResearcherId, _ := this.GetInt("RsCalendarResearcherId")
 
@@ -643,17 +647,20 @@ func (this *CalendarController) CalendarDetail() {
 	}
 
 	companyDetailView := new(roadshow.CompanyDetailView)
-
+	productId := services.GetProductId(sysUser.RoleTypeCode)
+	if productId == 0 {
+		productId = 1
+	}
 	if calendarItem != nil && calendarItem.CompanyId > 0 {
 		// 中文客户
 		if calendarItem.EnglishCompany == 0 {
 			companyId := calendarItem.CompanyId
-			companyProductItem, err := models.GetCompanyProductByCompanyIdAndProductId(companyId, 1)
+			companyProductItem, err := models.GetCompanyProductByCompanyIdAndProductId(companyId, productId)
 			if err != nil {
 				this.FailWithMessage("获取数据失败", "获取数据失败!GetCompanyProductByCompanyIdAndProductId:"+err.Error())
 				return
 			}
-			permissionList, err := models.GetCompanyProductReportPermissionList(companyId, 1)
+			permissionList, err := models.GetCompanyProductReportPermissionList(companyId, productId)
 			if err != nil {
 				this.FailWithMessage("搜索客户权限失败", "搜索客户权限失败!GetCompanyProductReportPermissionList:"+err.Error())
 				return