Browse Source

no message

xingzai 2 years ago
parent
commit
16c2cc5692
2 changed files with 14 additions and 10 deletions
  1. 2 1
      controllers/activity_special.go
  2. 12 9
      models/user_record.go

+ 2 - 1
controllers/activity_special.go

@@ -230,6 +230,7 @@ func (this *ActivitySpecialCoAntroller) SpecialTripAdd() {
 				br.ErrMsg = "获取日程数量信息失败,Err:" + err.Error()
 				br.ErrMsg = "获取日程数量信息失败,Err:" + err.Error()
 				return
 				return
 			}
 			}
+			go services.ActivitySpecialUserRmind(user, activityId, 2)
 			//判断是删除还是添加
 			//判断是删除还是添加
 			if total == 0 {
 			if total == 0 {
 				//获取销售信息
 				//获取销售信息
@@ -258,7 +259,7 @@ func (this *ActivitySpecialCoAntroller) SpecialTripAdd() {
 					br.ErrMsg = "操作失败,Err:" + err.Error()
 					br.ErrMsg = "操作失败,Err:" + err.Error()
 					return
 					return
 				}
 				}
-				go services.ActivitySpecialUserRmind(user, activityId, 2)
+
 				//SignupStatus  int    `description:"返回状态:1:成功 、2 :人数已满 、3:调研次数已用完、 4:超时"`
 				//SignupStatus  int    `description:"返回状态:1:成功 、2 :人数已满 、3:调研次数已用完、 4:超时"`
 			} else {
 			} else {
 				updateParams := make(map[string]interface{})
 				updateParams := make(map[string]interface{})

+ 12 - 9
models/user_record.go

@@ -129,14 +129,17 @@ func GetUserThirdRecordByUserId(userId int) (item *UserRecord, err error) {
 //根据手机号获取用户的openid
 //根据手机号获取用户的openid
 func GetUserRecordListByMobile(platform int, bindAccount string) (items []*OpenIdList, err error) {
 func GetUserRecordListByMobile(platform int, bindAccount string) (items []*OpenIdList, err error) {
 	var sql string
 	var sql string
-	if utils.RunMode == "release" {
-		sql = `SELECT cr.open_id,user_id FROM user_record  as u 
+	//if utils.RunMode == "release" {
+	//	sql = `SELECT cr.open_id,user_id FROM user_record  as u
+	//		INNER JOIN cygx_user_record AS cr ON cr.union_id = u.union_id
+	//		WHERE create_platform=? AND bind_account IN (` + bindAccount + `)`
+	//} else {
+	//	platform = 1
+	//	sql = `SELECT open_id,user_id FROM	user_record  WHERE create_platform =? AND bind_account IN (` + bindAccount + `)`
+	//}
+	sql = `SELECT cr.open_id,user_id FROM user_record  as u 
 			INNER JOIN cygx_user_record AS cr ON cr.union_id = u.union_id 
 			INNER JOIN cygx_user_record AS cr ON cr.union_id = u.union_id 
 			WHERE create_platform=? AND bind_account IN (` + bindAccount + `)`
 			WHERE create_platform=? AND bind_account IN (` + bindAccount + `)`
-	} else {
-		platform = 1
-		sql = `SELECT open_id,user_id FROM	user_record  WHERE create_platform =? AND bind_account IN (` + bindAccount + `)`
-	}
 	_, err = orm.NewOrm().Raw(sql, platform).QueryRows(&items)
 	_, err = orm.NewOrm().Raw(sql, platform).QueryRows(&items)
 	return
 	return
 }
 }
@@ -159,7 +162,7 @@ func GetOpenIdByUserIds(ids string) (item []*OpenIdList, err error) {
 	sql = `SELECT cr.open_id,wu.user_id FROM user_record  as u 
 	sql = `SELECT cr.open_id,wu.user_id FROM user_record  as u 
 			INNER JOIN cygx_user_record AS cr ON cr.union_id = u.union_id 
 			INNER JOIN cygx_user_record AS cr ON cr.union_id = u.union_id 
 			INNER JOIN wx_user AS wu ON wu.mobile = u.bind_account 
 			INNER JOIN wx_user AS wu ON wu.mobile = u.bind_account 
-			WHERE create_platform=4 AND u.user_id IN (`+ids+`)`
-	_,err = o.Raw(sql).QueryRows(&item)
+			WHERE create_platform=4 AND u.user_id IN (` + ids + `)`
+	_, err = o.Raw(sql).QueryRows(&item)
 	return
 	return
-}
+}