|
@@ -7,6 +7,8 @@ import (
|
|
|
|
|
|
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"` // 活动类型名称
|
|
@@ -41,7 +43,10 @@ type ActivityDetail struct {
|
|
|
|
|
|
// GetPageListByWhere 分页获取活动列表
|
|
|
func GetPageListByWhere(condition string, pars []interface{}, page, limit int, order string, userId int) (activities []ActivityItem, err error) {
|
|
|
- fields := []string{"activity_id", "activity_name", "activity_type_id", "activity_type_name", "start_time", "end_time", "speaker", "city", "speaker_head_pic", "speaker_background_pic"}
|
|
|
+ fields := []string{
|
|
|
+ "activity_id", "activity_name", "activity_type_id", "activity_type_name", "start_time", "end_time", "speaker",
|
|
|
+ "city", "speaker_head_pic", "speaker_background_pic", "first_activity_type_id", "first_activity_type_name",
|
|
|
+ }
|
|
|
queryOrder := "start_time asc"
|
|
|
if order != "" {
|
|
|
queryOrder = order
|
|
@@ -55,7 +60,7 @@ func GetDetailById(activityId int) (activity *ActivityDetail, err error) {
|
|
|
fields := []string{
|
|
|
"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",
|
|
|
- "link_participants", "is_limit_people", "limit_people_num", "report_link", "address",
|
|
|
+ "link_participants", "is_limit_people", "limit_people_num", "report_link", "address", "first_activity_type_id", "first_activity_type_name",
|
|
|
}
|
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).Select(fields).Where("activity_id", activityId).Scan(&activity).Error
|
|
|
return
|