Przeglądaj źródła

Merge branch 'cygx_10.12' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 rok temu
rodzic
commit
c64f3a5eb2
2 zmienionych plików z 22 dodań i 0 usunięć
  1. 7 0
      controllers/activity.go
  2. 15 0
      services/activity_signup.go

+ 7 - 0
controllers/activity.go

@@ -959,6 +959,13 @@ func (this *ActivityCoAntroller) SignupCancel() {
 		br.ErrMsg = "操作失败,Err:" + errInfo.Error()
 		return
 	}
+	cancelDeadlineMsg := services.CheckCancelDeadline(activityInfo)
+	if cancelDeadlineMsg != "" {
+		br.Msg = cancelDeadlineMsg
+		br.ErrMsg = cancelDeadlineMsg
+		return
+	}
+
 	resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式
 	if time.Now().After(resultTime.Add(-time.Minute * 60)) {
 		if signupType == 1 {

+ 15 - 0
services/activity_signup.go

@@ -155,6 +155,21 @@ func ActivityCancelDeadlineMsg(activityInfo *models.ActivityDetail) (popupMsg st
 	return
 }
 
+// 校验取消报名截止时间
+func CheckCancelDeadline(activityInfo *models.ActivityDetail) (popupMsg string) {
+	if !activityInfo.IsResearchPoints {
+		return
+	}
+	//获取活动是否扣点以及扣点规则明细
+	if activityInfo.CancelDeadline != utils.FormatDateTimeInit {
+		timeResp := utils.StrTimeToTime(activityInfo.CancelDeadline)
+		if timeResp.Before(time.Now()) {
+			popupMsg = "当前时间点已无法取消报名,\n\n若想取消,请联系对口销售"
+		}
+	}
+	return
+}
+
 // // 校验报名顺序 截止时间>点数>邮箱
 func CheckActivityUserAll(activityInfo *models.ActivityDetail, wxUser *models.WxUserItem) (popupMsg string, err error) {
 	_, popupMsg = CheckSiginupDeadline(activityInfo)