Ver Fonte

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

xingzai há 1 ano atrás
pai
commit
bef36fae2c
2 ficheiros alterados com 23 adições e 2 exclusões
  1. 5 2
      controllers/activity_sign.go
  2. 18 0
      services/activity_signin.go

+ 5 - 2
controllers/activity_sign.go

@@ -119,10 +119,13 @@ func (this *ActivitySignCoAntroller) Detail() {
 			}
 		}
 		//添加日志记录
-		go services.AddCygxActivitySigninLog(item)
+		services.AddCygxActivitySigninLog(item)
 
 		//把报名信息写入签到到会表
-		go services.AddCygxActivityOfflineMeetingDetail(activityId, user)
+		services.AddCygxActivityOfflineMeetingDetail(activityId, user)
+
+		//后期扫码签到,处理是否爽约限制
+		services.CygxActivityRestrictSignupByuid(user.UserId)
 	}
 
 	if user.Mobile != "" || total > 0 {

+ 18 - 0
services/activity_signin.go

@@ -146,3 +146,21 @@ func CygxActivityRestrictSignupByTask(cont context.Context) (err error) {
 	}
 	return
 }
+
+func CygxActivityRestrictSignupByuid(uid int) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg("判断是否加入黑名单记录失败"+err.Error(), 2)
+		}
+	}()
+	totalNomeet, err := models.GetActivitySignupNomeetingCountByUid(uid)
+	if err != nil {
+		err = errors.New("GetActivitySignupNomeetingCountByUid" + err.Error())
+		return err
+	}
+	if totalNomeet < 3 {
+		err = models.DeleteCygxActivityRestrictSignup(uid)
+	}
+	return
+}