Browse Source

查研观向9.4.0

xingzai 2 years ago
parent
commit
f426b5efa7

+ 31 - 4
controllers/activity.go

@@ -2,7 +2,6 @@ package controllers
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/services"
 	"hongze/hongze_clpt/services"
@@ -311,7 +310,6 @@ func (this *ActivityController) ActivityListNew() {
 		br.ErrMsg = "获取用户权限失败, Err: " + e.Error()
 		br.ErrMsg = "获取用户权限失败, Err: " + e.Error()
 		return
 		return
 	}
 	}
-
 	for k, v := range list {
 	for k, v := range list {
 
 
 		au := new(models.UserPermissionAuthInfo)
 		au := new(models.UserPermissionAuthInfo)
@@ -360,6 +358,17 @@ func (this *ActivityController) ActivityListNew() {
 		activityList = append(activityList, services.ActivityButtonShow(list[k], user))
 		activityList = append(activityList, services.ActivityButtonShow(list[k], user))
 	}
 	}
 
 
+	//处理不同的报名方式按钮回显
+	mapActivitySignup, err := services.GetActivitySignupResp(mapActivityId, user)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "GetActivitySignupResp,Err:" + err.Error()
+		return
+	}
+	for _, v := range activityList {
+		v.SignupType = mapActivitySignup[v.ActivityId]
+	}
+
 	// 查研观向7.4-判断标签是否为产业, 为产业时是否跳转资源包
 	// 查研观向7.4-判断标签是否为产业, 为产业时是否跳转资源包
 	if label != "" {
 	if label != "" {
 		industry, e := models.GetIndustryByName(label)
 		industry, e := models.GetIndustryByName(label)
@@ -403,10 +412,9 @@ func (this *ActivityController) ActivityListNew() {
 	//if keyWord != "" {
 	//if keyWord != "" {
 	//	go services.AddActivitykeyWordSearch(keyWord, user)
 	//	go services.AddActivitykeyWordSearch(keyWord, user)
 	//}
 	//}
-	fmt.Println(resp.Label)
+
 	//预处理返给前端的字段
 	//预处理返给前端的字段
 	resp.List = activityList
 	resp.List = activityList
-	fmt.Println(len(resp.List))
 	resp.Paging = page
 	resp.Paging = page
 	br.Ret = 200
 	br.Ret = 200
 	br.Success = true
 	br.Success = true
@@ -569,6 +577,15 @@ func (this *ActivityController) Detail() {
 			detailResp.VideoDetail = mapActivityVideo[activityId]
 			detailResp.VideoDetail = mapActivityVideo[activityId]
 		}
 		}
 
 
+		//处理不同的报名方式按钮回显
+		mapActivitySignup, err := services.GetActivitySignupResp(mapActivityId, user)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "GetActivitySignupResp,Err:" + err.Error()
+			return
+		}
+		detailResp.SignupType = mapActivitySignup[activityId]
+
 		resp.Detail = detailResp
 		resp.Detail = detailResp
 	} else {
 	} else {
 		hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
 		hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
@@ -1654,6 +1671,8 @@ func (this *ActivityController) ActivityListSearch() {
 		item.Title = v.ActivityName
 		item.Title = v.ActivityName
 		item.City = v.City
 		item.City = v.City
 		item.IsSignup = v.IsSignup
 		item.IsSignup = v.IsSignup
+		item.SignupType = v.SignupType
+		item.ActivityTypeId = v.ActivityTypeId
 		item.IsCancelMeetingReminder = v.IsCancelMeetingReminder
 		item.IsCancelMeetingReminder = v.IsCancelMeetingReminder
 		item.IsAppointment = v.IsAppointment
 		item.IsAppointment = v.IsAppointment
 		item.ActiveState = v.ActiveState
 		item.ActiveState = v.ActiveState
@@ -1941,6 +1960,13 @@ func (this *ActivityController) ScheduleList() {
 		br.ErrMsg = "GetActivityVideoResp,Err:" + err.Error()
 		br.ErrMsg = "GetActivityVideoResp,Err:" + err.Error()
 		return
 		return
 	}
 	}
+	//处理不同的报名方式按钮回显
+	mapActivitySignup, err := services.GetActivitySignupResp(mapActivityId, user)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "GetActivitySignupResp,Err:" + err.Error()
+		return
+	}
 	for k, v := range list {
 	for k, v := range list {
 		if mapActivityVoice[v.ActivityId] != nil {
 		if mapActivityVoice[v.ActivityId] != nil {
 			list[k].FileType = 1
 			list[k].FileType = 1
@@ -1952,6 +1978,7 @@ func (this *ActivityController) ScheduleList() {
 			list[k].AudioLink = true
 			list[k].AudioLink = true
 			list[k].VideoDetail = mapActivityVideo[v.ActivityId]
 			list[k].VideoDetail = mapActivityVideo[v.ActivityId]
 		}
 		}
+		v.SignupType = mapActivitySignup[v.ActivityId]
 		//处理列表的标签是否展示逻辑
 		//处理列表的标签是否展示逻辑
 		resp.List = append(resp.List, services.ActivityButtonShow(v, user))
 		resp.List = append(resp.List, services.ActivityButtonShow(v, user))
 	}
 	}

+ 1 - 0
models/activity.go

@@ -206,6 +206,7 @@ type ActivityListResp struct {
 	IsTrip                  int                        `description:"是否报名 1是 ,0 否"`
 	IsTrip                  int                        `description:"是否报名 1是 ,0 否"`
 	TripStatus              int                        `description:"行程进行状态 1:预报名,2:确定行程"`
 	TripStatus              int                        `description:"行程进行状态 1:预报名,2:确定行程"`
 	Days                    int                        `description:"调研天数"`
 	Days                    int                        `description:"调研天数"`
+	SignupType              int                        `description:"报名方式,1预约外呼,2自主拨入,3我要报名"`
 }
 }
 
 
 type ActivityArticleResp struct {
 type ActivityArticleResp struct {

+ 41 - 28
models/activity_signup.go

@@ -45,7 +45,7 @@ type ActivitySingnupRep struct {
 	SignupType int `description:"报名方式,,1预约外呼,2自主拨入,3我要报名"`
 	SignupType int `description:"报名方式,,1预约外呼,2自主拨入,3我要报名"`
 }
 }
 
 
-//我的日程
+// 我的日程
 type CygxMySchedule struct {
 type CygxMySchedule struct {
 	Id          int       `orm:"column(id);pk"`
 	Id          int       `orm:"column(id);pk"`
 	ActivityId  int       `description:"活动ID"`
 	ActivityId  int       `description:"活动ID"`
@@ -57,7 +57,7 @@ type CygxMySchedule struct {
 	CompanyName string    `description:"公司名称"`
 	CompanyName string    `description:"公司名称"`
 }
 }
 
 
-//报名记录日志
+// 报名记录日志
 type CygxActivitySignupLog struct {
 type CygxActivitySignupLog struct {
 	Id          int       `orm:"column(id);pk"`
 	Id          int       `orm:"column(id);pk"`
 	ActivityId  int       `description:"活动ID"`
 	ActivityId  int       `description:"活动ID"`
@@ -70,7 +70,7 @@ type CygxActivitySignupLog struct {
 	Type        int       `description:"操作方式,1报名,2取消报名"`
 	Type        int       `description:"操作方式,1报名,2取消报名"`
 }
 }
 
 
-//添加报名信息
+// 添加报名信息
 func AddActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 func AddActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 	o, err := orm.NewOrm().Begin()
 	o, err := orm.NewOrm().Begin()
 	if err != nil {
 	if err != nil {
@@ -132,7 +132,7 @@ func AddActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 	return
 	return
 }
 }
 
 
-//仅绑定邮箱的用户修改报名后,添加报名信息
+// 仅绑定邮箱的用户修改报名后,添加报名信息
 func AddActivitySignupFromEmail(item *CygxActivitySignup) (lastId int64, err error) {
 func AddActivitySignupFromEmail(item *CygxActivitySignup) (lastId int64, err error) {
 	o, err := orm.NewOrm().Begin()
 	o, err := orm.NewOrm().Begin()
 	if err != nil {
 	if err != nil {
@@ -199,7 +199,7 @@ func AddActivitySignupFromEmail(item *CygxActivitySignup) (lastId int64, err err
 	return
 	return
 }
 }
 
 
-//添加报名信息
+// 添加报名信息
 func AddActivitySignupNoSchedule(item *CygxActivitySignup) (lastId int64, err error) {
 func AddActivitySignupNoSchedule(item *CygxActivitySignup) (lastId int64, err error) {
 	o, err := orm.NewOrm().Begin()
 	o, err := orm.NewOrm().Begin()
 	if err != nil {
 	if err != nil {
@@ -230,7 +230,7 @@ func AddActivitySignupNoSchedule(item *CygxActivitySignup) (lastId int64, err er
 	return
 	return
 }
 }
 
 
-//获取用户报名成功数量
+// 获取用户报名成功数量
 func GetActivitySignupCount(uid, activityId int) (count int, err error) {
 func GetActivitySignupCount(uid, activityId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0  AND do_fail_type = 0 AND user_id=? AND activity_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0  AND do_fail_type = 0 AND user_id=? AND activity_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -238,7 +238,7 @@ func GetActivitySignupCount(uid, activityId int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取用户报名数量
+// 获取用户报名数量
 func GetActivitySignupByUserCount(uid, activityId int) (count int, err error) {
 func GetActivitySignupByUserCount(uid, activityId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0 AND user_id=? AND activity_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0 AND user_id=? AND activity_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -246,7 +246,7 @@ func GetActivitySignupByUserCount(uid, activityId int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取用户报名禁止数量
+// 获取用户报名禁止数量
 func GetActivitySignupByUserRestrictCount(uid, activityId int) (count int, err error) {
 func GetActivitySignupByUserRestrictCount(uid, activityId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE do_fail_type=3 AND user_id=? AND activity_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE do_fail_type=3 AND user_id=? AND activity_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -254,7 +254,7 @@ func GetActivitySignupByUserRestrictCount(uid, activityId int) (count int, err e
 	return
 	return
 }
 }
 
 
-//获取某一活动已经报名的数量
+// 获取某一活动已经报名的数量
 func GetActivitySignupSuccessCount(activityId int) (count int, err error) {
 func GetActivitySignupSuccessCount(activityId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0 AND do_fail_type = 0 AND activity_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0 AND do_fail_type = 0 AND activity_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -262,7 +262,7 @@ func GetActivitySignupSuccessCount(activityId int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取某一活动某个机构已经报名的数量
+// 获取某一活动某个机构已经报名的数量
 func GetActivitySignupCompanyCount(activityId, companyId int) (count int, err error) {
 func GetActivitySignupCompanyCount(activityId, companyId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0 AND fail_type = 0 AND activity_id=? AND company_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup WHERE is_cancel=0 AND fail_type = 0 AND activity_id=? AND company_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -270,7 +270,7 @@ func GetActivitySignupCompanyCount(activityId, companyId int) (count int, err er
 	return
 	return
 }
 }
 
 
-//获取某一用户是否被限制报名
+// 获取某一用户是否被限制报名
 func GetUserRestrictCount(mobile string) (count int, err error) {
 func GetUserRestrictCount(mobile string) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_restrict_signup WHERE is_restrict=1  AND mobile=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_restrict_signup WHERE is_restrict=1  AND mobile=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -278,7 +278,7 @@ func GetUserRestrictCount(mobile string) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取某一用户的日程数量
+// 获取某一用户的日程数量
 func GetUserMeetingReminderCount(uid int) (count int, err error) {
 func GetUserMeetingReminderCount(uid int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_my_schedule WHERE  user_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_my_schedule WHERE  user_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -286,7 +286,7 @@ func GetUserMeetingReminderCount(uid int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取某一用户的报名的数量
+// 获取某一用户的报名的数量
 func GetUserSignupCount(uid int) (count int, err error) {
 func GetUserSignupCount(uid int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup_log WHERE  user_id=? `
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_signup_log WHERE  user_id=? `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -294,7 +294,7 @@ func GetUserSignupCount(uid int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//取消报名
+// 取消报名
 func CancelActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 func CancelActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 	o, err := orm.NewOrm().Begin()
 	o, err := orm.NewOrm().Begin()
 	if err != nil {
 	if err != nil {
@@ -344,7 +344,7 @@ func CancelActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 	return
 	return
 }
 }
 
 
-//详情
+// 详情
 func GetActivitySignupDetail(activityId, uid int) (item *CygxActivitySignup, err error) {
 func GetActivitySignupDetail(activityId, uid int) (item *CygxActivitySignup, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT * FROM cygx_activity_signup WHERE  activity_id = ? AND user_id =? `
 	sql := `SELECT * FROM cygx_activity_signup WHERE  activity_id = ? AND user_id =? `
@@ -362,7 +362,7 @@ func GetActivitySignuListByUser(condition string, pars []interface{}) (item []*C
 	return
 	return
 }
 }
 
 
-//解除报名限制之后二次报名
+// 解除报名限制之后二次报名
 func AddActivitySignupByRestrict(item *CygxActivitySignup) (lastId int64, err error) {
 func AddActivitySignupByRestrict(item *CygxActivitySignup) (lastId int64, err error) {
 	o, err := orm.NewOrm().Begin()
 	o, err := orm.NewOrm().Begin()
 	if err != nil {
 	if err != nil {
@@ -403,7 +403,7 @@ func AddActivitySignupByRestrict(item *CygxActivitySignup) (lastId int64, err er
 	return
 	return
 }
 }
 
 
-//列表
+// 列表
 func GetActivitySignupListAll() (items []*CygxActivitySignup, err error) {
 func GetActivitySignupListAll() (items []*CygxActivitySignup, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT * FROM cygx_activity_signup `
 	sql := `SELECT * FROM cygx_activity_signup `
@@ -411,7 +411,7 @@ func GetActivitySignupListAll() (items []*CygxActivitySignup, err error) {
 	return
 	return
 }
 }
 
 
-//修改是否推送消息状态
+// 修改是否推送消息状态
 func UPdateSignup(item *CygxActivitySignup) (err error) {
 func UPdateSignup(item *CygxActivitySignup) (err error) {
 	sql := ` UPDATE cygx_activity_signup SET  outbound_mobile= ? , country_code=86  WHERE id = ?`
 	sql := ` UPDATE cygx_activity_signup SET  outbound_mobile= ? , country_code=86  WHERE id = ?`
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -419,7 +419,7 @@ func UPdateSignup(item *CygxActivitySignup) (err error) {
 	return
 	return
 }
 }
 
 
-//获取数量
+// 获取数量
 func GetActivityCountByIdWithUid(activityId, Uid int) (count int, err error) {
 func GetActivityCountByIdWithUid(activityId, Uid int) (count int, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sqlCount := `SELECT COUNT(1) AS count  FROM cygx_activity_signup WHERE activity_id = ? AND user_id = ?`
 	sqlCount := `SELECT COUNT(1) AS count  FROM cygx_activity_signup WHERE activity_id = ? AND user_id = ?`
@@ -427,7 +427,7 @@ func GetActivityCountByIdWithUid(activityId, Uid int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取用户报名数量
+// 获取用户报名数量
 func GetActivitySignupNomeetingCount(activityId int) (count int, err error) {
 func GetActivitySignupNomeetingCount(activityId int) (count int, err error) {
 	sqlCount := `SELECT
 	sqlCount := `SELECT
 	COUNT( 1 ) count 
 	COUNT( 1 ) count 
@@ -457,7 +457,7 @@ WHERE
 	return
 	return
 }
 }
 
 
-//获取用户是否被限制报名
+// 获取用户是否被限制报名
 func GetRestrictSignupCountByUid(uid int) (count int, err error) {
 func GetRestrictSignupCountByUid(uid int) (count int, err error) {
 	sqlCount := `SELECT COUNT( 1 ) count FROM cygx_activity_restrict_signup  WHERE user_id = ?`
 	sqlCount := `SELECT COUNT( 1 ) count FROM cygx_activity_restrict_signup  WHERE user_id = ?`
 	o := orm.NewOrm()
 	o := orm.NewOrm()
@@ -465,7 +465,7 @@ func GetRestrictSignupCountByUid(uid int) (count int, err error) {
 	return
 	return
 }
 }
 
 
-//获取用户爽约次数
+// 获取用户爽约次数
 func GetActivitySignupNomeetingCountByUid(uid int) (count int, err error) {
 func GetActivitySignupNomeetingCountByUid(uid int) (count int, err error) {
 	sqlCount := `SELECT
 	sqlCount := `SELECT
 	COUNT( 1 ) count 
 	COUNT( 1 ) count 
@@ -484,7 +484,7 @@ WHERE
 	return
 	return
 }
 }
 
 
-//删除
+// 删除
 func DeleteCygxActivityRestrictSignup(uid int) (err error) {
 func DeleteCygxActivityRestrictSignup(uid int) (err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := ` DELETE FROM cygx_activity_restrict_signup  WHERE user_id=?`
 	sql := ` DELETE FROM cygx_activity_restrict_signup  WHERE user_id=?`
@@ -504,7 +504,7 @@ type CygxActivitySignupList struct {
 	Channel     int    `description:"报名渠道,0 空降、 1小程序报名"`
 	Channel     int    `description:"报名渠道,0 空降、 1小程序报名"`
 }
 }
 
 
-//获取用户报名列表
+// 获取用户报名列表
 func GetActivitySignupNomeetingCountList(activityId int) (items []*CygxActivitySignupList, err error) {
 func GetActivitySignupNomeetingCountList(activityId int) (items []*CygxActivitySignupList, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT
 	sql := `SELECT
@@ -554,14 +554,14 @@ type CygxActivityRestrictSignup struct {
 	IsRestrict  int       `description:"是否限制报名,1是,0否"`
 	IsRestrict  int       `description:"是否限制报名,1是,0否"`
 }
 }
 
 
-//添加
+// 添加
 func AddCygxActivityRestrictSignup(item *CygxActivityRestrictSignup) (err error) {
 func AddCygxActivityRestrictSignup(item *CygxActivityRestrictSignup) (err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	_, err = o.Insert(item)
 	_, err = o.Insert(item)
 	return
 	return
 }
 }
 
 
-//获取列表信息根据手机号分组
+// 获取列表信息根据手机号分组
 func GetCygxActivitySignupByMobileList(condition string) (items []*CygxActivitySignup, err error) {
 func GetCygxActivitySignupByMobileList(condition string) (items []*CygxActivitySignup, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `SELECT * FROM cygx_activity_signup  WHERE  1= 1 ` + condition + `  GROUP BY mobile  `
 	sql := `SELECT * FROM cygx_activity_signup  WHERE  1= 1 ` + condition + `  GROUP BY mobile  `
@@ -569,7 +569,7 @@ func GetCygxActivitySignupByMobileList(condition string) (items []*CygxActivityS
 	return
 	return
 }
 }
 
 
-//修改用户报名的相关信息
+// 修改用户报名的相关信息
 func UpdateCygxActivitySignup(wxUser *WxUserItem) (err error) {
 func UpdateCygxActivitySignup(wxUser *WxUserItem) (err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_activity_signup SET email=?,company_id=?,company_name=?,user_id=?,real_name=? WHERE  mobile=? `
 	sql := `UPDATE cygx_activity_signup SET email=?,company_id=?,company_name=?,user_id=?,real_name=? WHERE  mobile=? `
@@ -577,10 +577,23 @@ func UpdateCygxActivitySignup(wxUser *WxUserItem) (err error) {
 	return
 	return
 }
 }
 
 
-//UpdateCygxActivitySignupisMeet 修改易董的活动,用户已到会
+// UpdateCygxActivitySignupisMeet 修改易董的活动,用户已到会
 func UpdateCygxActivitySignupisMeet(activityId int, mobile string) (err error) {
 func UpdateCygxActivitySignupisMeet(activityId int, mobile string) (err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_activity_signup SET is_meeting=1 WHERE activity_id=?  AND mobile = ? `
 	sql := `UPDATE cygx_activity_signup SET is_meeting=1 WHERE activity_id=?  AND mobile = ? `
 	_, err = o.Raw(sql, activityId, mobile).Exec()
 	_, err = o.Raw(sql, activityId, mobile).Exec()
 	return
 	return
 }
 }
+
+// GetCygxCygxActivitySignupList 获取报名列表信息
+func GetActivitySignupList(condition string, pars []interface{}) (items []*CygxActivitySignup, err error) {
+	sql := `SELECT
+			signup_type,activity_id
+		FROM
+			cygx_activity_signup AS v
+		WHERE
+			1 = 1 	` + condition
+	o := orm.NewOrm()
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}

+ 2 - 0
models/resource_data.go

@@ -61,6 +61,8 @@ type CygxResourceDataResp struct {
 	VideoDetail             *CygxActivityVideoListResp `description:"视频数据"`
 	VideoDetail             *CygxActivityVideoListResp `description:"视频数据"`
 	AudioLink               bool                       `description:"是否展示回放按钮"`
 	AudioLink               bool                       `description:"是否展示回放按钮"`
 	FileType                int                        `description:"类型: 1-音频; 2-视频"`
 	FileType                int                        `description:"类型: 1-音频; 2-视频"`
+	SignupType              int                        `description:"报名方式,1预约外呼,2自主拨入,3我要报名"`
+	ActivityTypeId          int                        `description:"活动类型id"`
 }
 }
 
 
 type HomeResourceDataListResp struct {
 type HomeResourceDataListResp struct {

+ 12 - 7
services/activity.go

@@ -430,21 +430,24 @@ func ActivityButtonShow(item *models.ActivityDetail, user *models.WxUserItem) (i
 
 
 			//专家电话会 1
 			//专家电话会 1
 			if articleDetail.ActivityTypeId == 1 {
 			if articleDetail.ActivityTypeId == 1 {
-				articleDetail.IsShowOutboundCall = true
-				if articleDetail.IsLimitPeople == 0 {
-					articleDetail.IsShowMeetingReminder = true
-					articleDetail.IsShowHelpSsk = true
+				if articleDetail.LimitPeopleNum == 0 {
+					articleDetail.IsShowOutboundCall = true
+				} else {
+					articleDetail.IsShowSignup = true
 				}
 				}
+				articleDetail.IsShowMeetingReminder = true
+				articleDetail.IsShowHelpSsk = true
 			}
 			}
 
 
 			//分析师电话会 2
 			//分析师电话会 2
 			if articleDetail.ActivityTypeId == 2 {
 			if articleDetail.ActivityTypeId == 2 {
-				articleDetail.IsShowOutboundCall = true
 				if articleDetail.LimitPeopleNum == 0 {
 				if articleDetail.LimitPeopleNum == 0 {
-					articleDetail.IsShowMeetingReminder = true
+					articleDetail.IsShowOutboundCall = true
+				} else {
+					articleDetail.IsShowSignup = true
 				}
 				}
+				articleDetail.IsShowMeetingReminder = true
 			}
 			}
-
 			//公司调研电话会 3
 			//公司调研电话会 3
 			if articleDetail.ActivityTypeId == 3 {
 			if articleDetail.ActivityTypeId == 3 {
 				if articleDetail.LimitPeopleNum == 0 {
 				if articleDetail.LimitPeopleNum == 0 {
@@ -473,6 +476,7 @@ func ActivityButtonShow(item *models.ActivityDetail, user *models.WxUserItem) (i
 			//分析师电话会(C类) 7
 			//分析师电话会(C类) 7
 			if articleDetail.ActivityTypeId == 7 {
 			if articleDetail.ActivityTypeId == 7 {
 				articleDetail.IsShowSignup = true
 				articleDetail.IsShowSignup = true
+				articleDetail.IsShowMeetingReminder = true
 			}
 			}
 		}
 		}
 	}
 	}
@@ -539,6 +543,7 @@ func ActivityButtonShow(item *models.ActivityDetail, user *models.WxUserItem) (i
 		Explain:                 utils.ACtIVITY_SPECIAL_EXPLAIN,
 		Explain:                 utils.ACtIVITY_SPECIAL_EXPLAIN,
 		TripImgLink:             v.TripImgLink,
 		TripImgLink:             v.TripImgLink,
 		Days:                    v.Days,
 		Days:                    v.Days,
+		SignupType:              v.SignupType,
 	}
 	}
 	au := new(models.UserPermissionAuthInfo)
 	au := new(models.UserPermissionAuthInfo)
 	au.SellerName = authInfo.SellerName
 	au.SellerName = authInfo.SellerName

+ 26 - 14
services/activity_button.go

@@ -9,7 +9,7 @@ import (
 	"time"
 	"time"
 )
 )
 
 
-//获取用户已经报名的活动
+// 获取用户已经报名的活动
 func GetActivitySignUpUserMap(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 func GetActivitySignUpUserMap(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 	userId := user.UserId
 	userId := user.UserId
 	var condition string
 	var condition string
@@ -34,7 +34,7 @@ func GetActivitySignUpUserMap(activityIds []int, user *models.WxUserItem) (mapUs
 	return
 	return
 }
 }
 
 
-//获取用户已经设置会议提醒的活动  cygx_activity_meeting_reminder
+// 获取用户已经设置会议提醒的活动  cygx_activity_meeting_reminder
 func GetActivityReminderUserMasp(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 func GetActivityReminderUserMasp(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 	userId := user.UserId
 	userId := user.UserId
 	var condition string
 	var condition string
@@ -59,7 +59,7 @@ func GetActivityReminderUserMasp(activityIds []int, user *models.WxUserItem) (ma
 	return
 	return
 }
 }
 
 
-//获取用户已经预约纪要的活动
+// 获取用户已经预约纪要的活动
 func GetActivityAppointmentUserMap(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 func GetActivityAppointmentUserMap(activityIds []int, user *models.WxUserItem) (mapUserId map[int]int, err error) {
 	userId := user.UserId
 	userId := user.UserId
 	var condition string
 	var condition string
@@ -84,7 +84,7 @@ func GetActivityAppointmentUserMap(activityIds []int, user *models.WxUserItem) (
 	return
 	return
 }
 }
 
 
-//活动列表的展示  HandleActivityListButton
+// 活动列表的展示  HandleActivityListButton
 func HandleActivityListButton(list []*models.ActivityDetail, user *models.WxUserItem) (items []*models.ActivityDetail, err error) {
 func HandleActivityListButton(list []*models.ActivityDetail, user *models.WxUserItem) (items []*models.ActivityDetail, err error) {
 	var activityIds []int
 	var activityIds []int
 	var activitySpecilalIds []int
 	var activitySpecilalIds []int
@@ -254,6 +254,13 @@ func HandleActivityListButton(list []*models.ActivityDetail, user *models.WxUser
 		return
 		return
 	}
 	}
 
 
+	//处理不同的报名方式按钮回显
+	mapActivitySignup, e := GetActivitySignupResp(mapActivityId, user)
+	if e != nil {
+		err = errors.New("GetActivityVoiceResp, Err: " + e.Error())
+		return
+	}
+
 	//处理视频回放
 	//处理视频回放
 	mapActivityVideo, e := GetActivityVideoResp(mapActivityId)
 	mapActivityVideo, e := GetActivityVideoResp(mapActivityId)
 	if e != nil {
 	if e != nil {
@@ -271,6 +278,7 @@ func HandleActivityListButton(list []*models.ActivityDetail, user *models.WxUser
 			list[k].AudioLink = true
 			list[k].AudioLink = true
 			list[k].VideoDetail = mapActivityVideo[v.ActivityId]
 			list[k].VideoDetail = mapActivityVideo[v.ActivityId]
 		}
 		}
+		v.SignupType = mapActivitySignup[v.ActivityId]
 		items = append(items, ActivityButtonShowSearch(v, user))
 		items = append(items, ActivityButtonShowSearch(v, user))
 	}
 	}
 	return
 	return
@@ -313,25 +321,28 @@ func ActivityButtonShowSearch(item *models.ActivityDetail, user *models.WxUserIt
 			articleDetail.IsShowHelpSsk = true
 			articleDetail.IsShowHelpSsk = true
 		}
 		}
 		if articleDetail.ActiveState == "1" {
 		if articleDetail.ActiveState == "1" {
-			//新的是否展示规则
-			if articleDetail.IsCanAppointmentMinutes == 1 {
-				articleDetail.IsShowAppointment = true
-			}
 			//专家电话会 1
 			//专家电话会 1
+			//专家电话会限制人数的展示我要报名,不限制的展示预约外外呼
 			if articleDetail.ActivityTypeId == 1 {
 			if articleDetail.ActivityTypeId == 1 {
-				articleDetail.IsShowOutboundCall = true
-				if articleDetail.IsLimitPeople == 0 {
-					articleDetail.IsShowMeetingReminder = true
-					articleDetail.IsShowHelpSsk = true
+				//articleDetail.IsShowOutboundCall = true
+				if articleDetail.LimitPeopleNum == 0 {
+					articleDetail.IsShowOutboundCall = true
+					//articleDetail.IsShowHelpSsk = true
+				} else {
+					articleDetail.IsShowSignup = true
 				}
 				}
+				articleDetail.IsShowMeetingReminder = true
+				articleDetail.IsShowHelpSsk = true
 			}
 			}
 
 
 			//分析师电话会 2
 			//分析师电话会 2
 			if articleDetail.ActivityTypeId == 2 {
 			if articleDetail.ActivityTypeId == 2 {
-				articleDetail.IsShowOutboundCall = true
 				if articleDetail.LimitPeopleNum == 0 {
 				if articleDetail.LimitPeopleNum == 0 {
-					articleDetail.IsShowMeetingReminder = true
+					articleDetail.IsShowOutboundCall = true
+				} else {
+					articleDetail.IsShowSignup = true
 				}
 				}
+				articleDetail.IsShowMeetingReminder = true
 			}
 			}
 
 
 			//公司调研电话会 3
 			//公司调研电话会 3
@@ -362,6 +373,7 @@ func ActivityButtonShowSearch(item *models.ActivityDetail, user *models.WxUserIt
 			//分析师电话会(C类) 7
 			//分析师电话会(C类) 7
 			if articleDetail.ActivityTypeId == 7 {
 			if articleDetail.ActivityTypeId == 7 {
 				articleDetail.IsShowSignup = true
 				articleDetail.IsShowSignup = true
+				articleDetail.IsShowMeetingReminder = true
 			}
 			}
 		}
 		}
 	}
 	}

+ 30 - 0
services/activity_signup.go

@@ -0,0 +1,30 @@
+package services
+
+import (
+	"errors"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/utils"
+)
+
+// GetActivitySignupResp 处理用户的报名方式
+func GetActivitySignupResp(activityIdS []int, user *models.WxUserItem) (mapItem map[int]int, err error) {
+	var condition string
+	var pars []interface{}
+	lenActivityId := len(activityIdS)
+	if lenActivityId == 0 || user.Mobile == "" {
+		return
+	}
+	condition = ` AND do_fail_type = 0 AND activity_id IN (` + utils.GetOrmInReplace(lenActivityId) + `) AND mobile = ?`
+	pars = append(pars, activityIdS, user.Mobile)
+
+	listSignup, e := models.GetActivitySignupList(condition, pars)
+	if e != nil {
+		err = errors.New("GetResourceDataList, Err: " + e.Error())
+		return
+	}
+	mapItem = make(map[int]int, 0)
+	for _, v := range listSignup {
+		mapItem[v.ActivityId] = v.SignupType
+	}
+	return
+}

+ 8 - 1
services/resource_data.go

@@ -134,6 +134,12 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		for _, v := range activityList {
 		for _, v := range activityList {
 			activityListRersp = append(activityListRersp, ActivityButtonShow(v, user))
 			activityListRersp = append(activityListRersp, ActivityButtonShow(v, user))
 		}
 		}
+		//处理不同的报名方式按钮回显
+		mapActivitySignup, e := GetActivitySignupResp(activityIds, user)
+		if e != nil {
+			err = errors.New("GetActivitySignupResp, Err: " + e.Error())
+			return
+		}
 		for _, v := range activityListRersp {
 		for _, v := range activityListRersp {
 			if v == nil {
 			if v == nil {
 				continue
 				continue
@@ -149,7 +155,6 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 					imgUrlResp = mapChart[v.ChartPermissionName]
 					imgUrlResp = mapChart[v.ChartPermissionName]
 				}
 				}
 			}
 			}
-
 			mapItems[fmt.Sprint("activity", v.ActivityId)].Title = v.ActivityName
 			mapItems[fmt.Sprint("activity", v.ActivityId)].Title = v.ActivityName
 			mapItems[fmt.Sprint("activity", v.ActivityId)].City = v.City
 			mapItems[fmt.Sprint("activity", v.ActivityId)].City = v.City
 			mapItems[fmt.Sprint("activity", v.ActivityId)].IsSignup = v.IsSignup
 			mapItems[fmt.Sprint("activity", v.ActivityId)].IsSignup = v.IsSignup
@@ -170,6 +175,8 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			mapItems[fmt.Sprint("activity", v.ActivityId)].DistinguishedGuest = v.DistinguishedGuest
 			mapItems[fmt.Sprint("activity", v.ActivityId)].DistinguishedGuest = v.DistinguishedGuest
 			mapItems[fmt.Sprint("activity", v.ActivityId)].YidongActivityUrl = v.YidongActivityUrl
 			mapItems[fmt.Sprint("activity", v.ActivityId)].YidongActivityUrl = v.YidongActivityUrl
 			mapItems[fmt.Sprint("activity", v.ActivityId)].ImgUrl = imgUrlResp
 			mapItems[fmt.Sprint("activity", v.ActivityId)].ImgUrl = imgUrlResp
+			mapItems[fmt.Sprint("activity", v.ActivityId)].SignupType = mapActivitySignup[v.ActivityId]
+			mapItems[fmt.Sprint("activity", v.ActivityId)].ActivityTypeId = v.ActivityTypeId
 		}
 		}
 	}
 	}