|
@@ -6,40 +6,42 @@ import (
|
|
)
|
|
)
|
|
|
|
|
|
type ActivityItem struct {
|
|
type ActivityItem struct {
|
|
- ActivityID int `json:"activityId"`
|
|
|
|
- FirstActivityTypeID int `json:"firstActivityTypeId"` // 第一级的活动类型ID
|
|
|
|
- FirstActivityTypeName string `json:"firstActivityTypeName"` // 第一级的活动类型名称
|
|
|
|
- ActivityName string `json:"activityName"` // 活动名称
|
|
|
|
- ActivityTypeID int `json:"activityTypeId"` // 活动类型ID
|
|
|
|
- ActivityTypeName string `json:"activityTypeName"` // 活动类型名称
|
|
|
|
- StartTime time.Time `json:"startTime"` // 活动开始时间
|
|
|
|
- EndTime time.Time `json:"endTime"` // 活动结束时间
|
|
|
|
- Speaker string `json:"speaker"` // 主讲人
|
|
|
|
- SpeakerHeadPic string `json:"speakerHeadPic"` // 主讲人头像
|
|
|
|
- SpeakerBackgroundPic string `json:"speakerBackgroundPic"` // 主讲人背景图
|
|
|
|
- City string `json:"city"` // 城市
|
|
|
|
- WeekString string `json:"weekString"` // 周几
|
|
|
|
- HasRemind int `json:"hasRemind"` // 是否已提醒
|
|
|
|
- HasPlayBack int `json:"hasPlayBack"` // 是否有回放
|
|
|
|
- RegisterState int `json:"registerState"` // 报名状态 0-取消报名 1-已报名
|
|
|
|
- ActivityState int `json:"activityState"` // 活动状态 1-本周预告 2-进行中 3-已结束
|
|
|
|
|
|
+ ActivityID int `json:"activityId"`
|
|
|
|
+ FirstActivityTypeID int `json:"firstActivityTypeId"` // 第一级的活动类型ID
|
|
|
|
+ FirstActivityTypeName string `json:"firstActivityTypeName"` // 第一级的活动类型名称
|
|
|
|
+ ActivityName string `json:"activityName"` // 活动名称
|
|
|
|
+ ActivityTypeID int `json:"activityTypeId"` // 活动类型ID
|
|
|
|
+ ActivityTypeName string `json:"activityTypeName"` // 活动类型名称
|
|
|
|
+ StartTime time.Time `json:"startTime"` // 活动开始时间
|
|
|
|
+ EndTime time.Time `json:"endTime"` // 活动结束时间
|
|
|
|
+ Speaker string `json:"speaker"` // 主讲人
|
|
|
|
+ SpeakerHeadPic string `json:"speakerHeadPic"` // 主讲人头像
|
|
|
|
+ SpeakerBackgroundPic string `json:"speakerBackgroundPic"` // 主讲人背景图
|
|
|
|
+ City string `json:"city"` // 城市
|
|
|
|
+ WeekString string `json:"weekString"` // 周几
|
|
|
|
+ HasRemind int `json:"hasRemind"` // 是否已提醒
|
|
|
|
+ HasPlayBack int `json:"hasPlayBack"` // 是否有回放
|
|
|
|
+ RegisterState int `json:"registerState"` // 报名状态 0-取消报名 1-已报名
|
|
|
|
+ ActivityState int `json:"activityState"` // 活动状态 1-本周预告 2-进行中 3-已结束
|
|
}
|
|
}
|
|
|
|
|
|
type ActivityDetail struct {
|
|
type ActivityDetail struct {
|
|
ActivityItem
|
|
ActivityItem
|
|
- MainlandTel string `json:"mainlandTel"` // 大陆拨入
|
|
|
|
- HongKongTel string `json:"hongKongTel"` // 香港拨入
|
|
|
|
- TaiwanTel string `json:"taiwanTel"` // 台湾拨入
|
|
|
|
- AmericaTel string `json:"americaTel"` // 美国拨入
|
|
|
|
- SingaporeTel string `json:"singaporeTel"` // 新加坡拨入
|
|
|
|
- ParticipationCode string `json:"participationCode"` // 参会密码
|
|
|
|
- LinkParticipants string `json:"linkParticipants"` // 参会链接
|
|
|
|
- IsLimitPeople int8 `json:"isLimitPeople"` // 是否限制人数 1是,0否
|
|
|
|
- LimitPeopleNum int `json:"limitPeopleNum"` // 限制人数数量
|
|
|
|
- ReportLink string `json:"reportLink"` // 报告链接
|
|
|
|
- ReportName string `json:"reportName"` // 报告名称
|
|
|
|
- Address string `json:"address"` // 活动地址
|
|
|
|
- RegisteredNum int `json:"registeredNum"` // 已报名人数
|
|
|
|
|
|
+ MainlandTel string `json:"mainlandTel"` // 大陆拨入
|
|
|
|
+ HongKongTel string `json:"hongKongTel"` // 香港拨入
|
|
|
|
+ TaiwanTel string `json:"taiwanTel"` // 台湾拨入
|
|
|
|
+ AmericaTel string `json:"americaTel"` // 美国拨入
|
|
|
|
+ SingaporeTel string `json:"singaporeTel"` // 新加坡拨入
|
|
|
|
+ ParticipationCode string `json:"participationCode"` // 参会密码
|
|
|
|
+ LinkParticipants string `json:"linkParticipants"` // 参会链接
|
|
|
|
+ IsLimitPeople int8 `json:"isLimitPeople"` // 是否限制人数 1是,0否
|
|
|
|
+ LimitPeopleNum int `json:"limitPeopleNum"` // 限制人数数量
|
|
|
|
+ ReportLink string `json:"reportLink"` // 报告链接
|
|
|
|
+ ReportName string `json:"reportName"` // 报告名称
|
|
|
|
+ Address string `json:"address"` // 活动地址
|
|
|
|
+ RegisteredNum int `json:"registeredNum"` // 已报名人数
|
|
|
|
+ ReportId int `json:"report_id"` // 报告ID
|
|
|
|
+ IsNewReport int `json:"is_new_report"` // 是否关联新报告
|
|
}
|
|
}
|
|
|
|
|
|
// GetPageListByWhere 分页获取活动列表
|
|
// GetPageListByWhere 分页获取活动列表
|
|
@@ -60,7 +62,7 @@ func GetPageListByWhere(condition string, pars []interface{}, page, limit int, o
|
|
func GetDetailById(activityId int) (activity *ActivityDetail, err error) {
|
|
func GetDetailById(activityId int) (activity *ActivityDetail, err error) {
|
|
fields := []string{
|
|
fields := []string{
|
|
"activity_id", "activity_name", "activity_type_id", "activity_type_name", "start_time", "end_time", "speaker", "city", "speaker_head_pic", "speaker_background_pic",
|
|
"activity_id", "activity_name", "activity_type_id", "activity_type_name", "start_time", "end_time", "speaker", "city", "speaker_head_pic", "speaker_background_pic",
|
|
- "mainland_tel", "hong_kong_tel", "taiwan_tel", "america_tel", "singapore_tel", "participation_code",
|
|
|
|
|
|
+ "mainland_tel", "hong_kong_tel", "taiwan_tel", "america_tel", "singapore_tel", "participation_code", "report_id", "is_new_report",
|
|
"link_participants", "is_limit_people", "limit_people_num", "report_link", "report_name", "address", "first_activity_type_id", "first_activity_type_name",
|
|
"link_participants", "is_limit_people", "limit_people_num", "report_link", "report_name", "address", "first_activity_type_id", "first_activity_type_name",
|
|
}
|
|
}
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Select(fields).Where("activity_id", activityId).Scan(&activity).Error
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Select(fields).Where("activity_id", activityId).Scan(&activity).Error
|
|
@@ -74,7 +76,7 @@ func GetOneById(activityId int) (activity *YbActivity, err error) {
|
|
}
|
|
}
|
|
|
|
|
|
// GetActivityByIDsAndDate 根据时间和活动ID筛选出合适的记录
|
|
// GetActivityByIDsAndDate 根据时间和活动ID筛选出合适的记录
|
|
-func GetActivityByIDsAndDate( ids []int, publishTime string) (list []*YbActivity, err error) {
|
|
|
|
|
|
+func GetActivityByIDsAndDate(ids []int, publishTime string) (list []*YbActivity, err error) {
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
Select("DISTINCT activity_id").
|
|
Select("DISTINCT activity_id").
|
|
Where("activity_id in (?) and publish_status = 1 and create_time > ? and is_delete = 0", ids, publishTime).Scan(&list).Error
|
|
Where("activity_id in (?) and publish_status = 1 and create_time > ? and is_delete = 0", ids, publishTime).Scan(&list).Error
|
|
@@ -82,13 +84,13 @@ func GetActivityByIDsAndDate( ids []int, publishTime string) (list []*YbActivity
|
|
}
|
|
}
|
|
|
|
|
|
// GetLatestByIds 获取最新的活动
|
|
// GetLatestByIds 获取最新的活动
|
|
-func GetLatestByIds(activityids []int) (activity *YbActivity, err error) {
|
|
|
|
|
|
+func GetLatestByIds(activityids []int) (activity *YbActivity, err error) {
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityids).Order("create_time desc").First(&activity).Error
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityids).Order("create_time desc").First(&activity).Error
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
// GetListByIds 分页查询活动列表
|
|
// GetListByIds 分页查询活动列表
|
|
-func GetListByIds(activityids []int, offset , limit int) (activitys []*YbActivity, err error) {
|
|
|
|
|
|
+func GetListByIds(activityids []int, offset, limit int) (activitys []*YbActivity, err error) {
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityids).
|
|
Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityids).
|
|
Order("create_time desc").
|
|
Order("create_time desc").
|
|
@@ -99,16 +101,15 @@ func GetListByIds(activityids []int, offset , limit int) (activitys []*YbActivit
|
|
}
|
|
}
|
|
|
|
|
|
// GetListCountByIds 查询活动列表总数
|
|
// GetListCountByIds 查询活动列表总数
|
|
-func GetListCountByIds(activityIds []int) (total int64, err error) {
|
|
|
|
|
|
+func GetListCountByIds(activityIds []int) (total int64, err error) {
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityIds).
|
|
Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityIds).
|
|
Count(&total).Error
|
|
Count(&total).Error
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// GetLatestActivity 获取最新的活动
|
|
// GetLatestActivity 获取最新的活动
|
|
-func GetLatestActivity() (activity *YbActivity, err error) {
|
|
|
|
|
|
+func GetLatestActivity() (activity *YbActivity, err error) {
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Where("is_delete = 0 and publish_status = 1").Order("create_time desc").First(&activity).Error
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Where("is_delete = 0 and publish_status = 1").Order("create_time desc").First(&activity).Error
|
|
return
|
|
return
|
|
-}
|
|
|
|
|
|
+}
|