Browse Source

no message

xingzai 2 years ago
parent
commit
d489deb29e
2 changed files with 25 additions and 1 deletions
  1. 0 1
      models/activity.go
  2. 25 0
      services/activity_button.go

+ 0 - 1
models/activity.go

@@ -455,7 +455,6 @@ func UpdateActivitySattusToHaveInHand() (err error) {
 	condition += ` OR(activity_type_id IN ( 4, 5, 6 ) AND  activity_time > ` + "'" + resultTime_60 + "'" + sqlOr + ")"
 	msql := " UPDATE cygx_activity SET active_state = 2 WHERE 1 = 1 " + condition
 	_, err = o.Raw(msql).Exec()
-
 	return
 }
 

+ 25 - 0
services/activity_button.go

@@ -31,6 +31,31 @@ func GetActivitySignUpUserMap(activityIds []int, user *models.WxUserItem) (mapUs
 	return
 }
 
+//获取用户已经预约纪要的活动  cygx_activity_meeting_reminder
+func GetActivityAppointmentUserMasp(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
+	userId := user.UserId
+	var condition string
+	var pars []interface{}
+	activityIdsLen := len(activityIds)
+	if activityIdsLen > 0 {
+		condition += ` AND activity_id IN (` + utils.GetOrmInReplace(activityIdsLen) + `)`
+		pars = append(pars, activityIds)
+	}
+	condition += ` AND user_id = ?  `
+	pars = append(pars, userId)
+	list, e := models.GetCygxAppointmentListByUser(condition, pars)
+	if e != nil {
+		err = errors.New("GetCygxActivitySpecialTripList, Err: " + e.Error())
+		return
+	}
+	mapUid := make(map[int]int)
+	for _, v := range list {
+		mapUid[v.ActivityId] = v.UserId
+	}
+	mapUserId = mapUid
+	return
+}
+
 //获取用户已经预约纪要的活动
 func GetActivityAppointmentUserMap(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 	userId := user.UserId