Переглянути джерело

处理冻结客户,流失客户的弹窗提示v2

xingzai 2 роки тому
батько
коміт
fafe7dbff5
1 змінених файлів з 78 додано та 0 видалено
  1. 78 0
      controllers/activity.go

+ 78 - 0
controllers/activity.go

@@ -1060,6 +1060,25 @@ func (this *ActivityCoAntroller) SignupAdd() {
 	if signupType == 1 && user.Mobile == "" && user.OutboundMobile == "" {
 		resp.GoBindEmail = true
 	}
+	//处理冻结客户,流失客户的弹窗提示
+	if user.CompanyId > 1 {
+		sellerMobile, sellerRealName, err := services.CheckActivityUserPermission(user)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
+			return
+		}
+		if sellerMobile != "" {
+			resp.HasPermission = 2
+			resp.SellerMobile = sellerMobile
+			resp.SellerName = sellerRealName
+			br.Ret = 200
+			br.Success = true
+			br.Msg = "获取成功"
+			br.Data = resp
+			return
+		}
+	}
 	//判断是否已经申请过
 	applyCount, err := models.GetApplyRecordCount(uid)
 	if err != nil && err.Error() != utils.ErrNoRow() {
@@ -1743,6 +1762,26 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
 	item := new(models.CygxActivityMeetingReminder)
 	resp := new(models.SignupStatus)
 	hasPermission := 0
+
+	//处理冻结客户,流失客户的弹窗提示
+	if user.CompanyId > 1 {
+		sellerMobile, sellerRealName, err := services.CheckActivityUserPermission(user)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
+			return
+		}
+		if sellerMobile != "" {
+			resp.HasPermission = 2
+			resp.SellerMobile = sellerMobile
+			resp.SellerName = sellerRealName
+			br.Ret = 200
+			br.Success = true
+			br.Msg = "获取成功"
+			br.Data = resp
+			return
+		}
+	}
 	var companyDetailStatus string
 	if user.CompanyId <= 1 {
 		companyDetailStatus = ""
@@ -3320,6 +3359,26 @@ func (this *ActivityCoAntroller) CheckAsk() {
 		return
 	}
 	resp := new(models.SignupStatus)
+
+	//处理冻结客户,流失客户的弹窗提示
+	if user.CompanyId > 1 {
+		sellerMobile, sellerRealName, err := services.CheckActivityUserPermission(user)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
+			return
+		}
+		if sellerMobile != "" {
+			resp.HasPermission = 2
+			resp.SellerMobile = sellerMobile
+			resp.SellerName = sellerRealName
+			br.Ret = 200
+			br.Success = true
+			br.Msg = "获取成功"
+			br.Data = resp
+			return
+		}
+	}
 	hasPermission := 0
 	var companyDetailStatus string
 	if user.CompanyId <= 1 {
@@ -4784,6 +4843,25 @@ func (this *ActivityCoAntroller) ActivityAppointmentAdd() {
 	//SignupStatus string `description:"报名状态:人数已满:FullStarffed、单机构超过两人:TwoPeople、爽约次数过多:BreakPromise、超时:Overtime 、成功:Success"`
 	item := new(models.CygxActivityAppointment)
 	resp := new(models.SignupStatus)
+	//处理冻结客户,流失客户的弹窗提示
+	if user.CompanyId > 1 {
+		sellerMobile, sellerRealName, err := services.CheckActivityUserPermission(user)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
+			return
+		}
+		if sellerMobile != "" {
+			resp.HasPermission = 2
+			resp.SellerMobile = sellerMobile
+			resp.SellerName = sellerRealName
+			br.Ret = 200
+			br.Success = true
+			br.Msg = "获取成功"
+			br.Data = resp
+			return
+		}
+	}
 	hasPermission := 0
 	var companyDetailStatus string
 	if user.CompanyId <= 1 {