Browse Source

no message

zhangchuanxing 1 month ago
parent
commit
a6608fd6ad

+ 12 - 0
controllers/roadshow/calendar_meeting_user.go

@@ -80,6 +80,18 @@ func (this *CalendarMeetingUserController) Add() {
 		br.ErrMsg = "获取信息失败-AddRsCalendarMeetingLabelGroupMulti!Err:" + err.Error()
 		return
 	}
+
+	//listOld, err := roadshow.GetRsCalendarMeetingUserListByRsCalendarId(rsCalendarId)
+	//if err != nil {
+	//	br.Msg = "获取失败!"
+	//	br.ErrMsg = "操作失败-GetRsCalendarMeetingUserListByRsCalendarId!Err:" + err.Error()
+	//	return
+	//}
+	//mapUserId := make(map[int]bool)
+	//for _, v := range listOld {
+	//	mapUserId[v.UserId] = true
+	//}
+
 	var items []*roadshow.RsCalendarMeetingUser
 	if len(userIds) > 0 {
 		var userIdsStr []string

+ 2 - 1
models/cygx/activity_signup.go

@@ -163,12 +163,13 @@ type GetOutboundPersonnelRep struct {
 	RealName    string `description:"姓名"`
 	Mobile      string `description:"手机号"`
 	CompanyName string `description:"公司名称"`
+	Position    string `description:"职位"`
 }
 
 // 列表
 func GetOutboundPersonnelList(name string) (items []*GetOutboundPersonnelRep, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT u.user_id,u.real_name,u.mobile,p.company_name FROM wx_user as u INNER JOIN company AS p ON p.company_id = u.company_id WHERE  real_name LIKE '%` + name + `%'  AND u.company_id >1   GROUP BY u.user_id  ORDER BY user_id ASC`
+	sql := `SELECT u.position,u.user_id,u.real_name,u.mobile,p.company_name FROM wx_user as u INNER JOIN company AS p ON p.company_id = u.company_id WHERE  real_name LIKE '%` + name + `%'  AND u.company_id >1   GROUP BY u.user_id  ORDER BY user_id ASC`
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }

+ 5 - 0
models/roadshow/rs_calendar_meeting_user.go

@@ -42,6 +42,7 @@ type RsCalendarMeetingUserResp struct {
 	RealName                string `description:"用户实际名称"`
 	Position                string `description:"职位"`
 	RoadShowTheme           string `description:"路演主题"`
+	UserId                  int    `description:"用户ID"`
 }
 
 type DeleteRsCalendarMeetingUserReq struct {
@@ -74,6 +75,10 @@ func MultiAddRsCalendarMeetingUser(items []*RsCalendarMeetingUser, roadShowTheme
 		return
 	}
 
+	//删除老的数据
+	sql = ` DELETE FROM rs_calendar_meeting_user WHERE rs_calendar_id=? `
+	_, err = to.Raw(sql, rsCalendarId).Exec()
+
 	if len(items) > 0 {
 		_, err = to.InsertMulti(len(items), items)
 		if err != nil {