|
@@ -6,40 +6,42 @@ import (
|
|
|
)
|
|
|
|
|
|
type ActivityItem struct {
|
|
|
- ActivityID int `json:"activityId"`
|
|
|
- FirstActivityTypeID int `json:"firstActivityTypeId"`
|
|
|
- FirstActivityTypeName string `json:"firstActivityTypeName"`
|
|
|
- ActivityName string `json:"activityName"`
|
|
|
- ActivityTypeID int `json:"activityTypeId"`
|
|
|
- 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"`
|
|
|
- ActivityState int `json:"activityState"`
|
|
|
+ ActivityID int `json:"activityId"`
|
|
|
+ FirstActivityTypeID int `json:"firstActivityTypeId"`
|
|
|
+ FirstActivityTypeName string `json:"firstActivityTypeName"`
|
|
|
+ ActivityName string `json:"activityName"`
|
|
|
+ ActivityTypeID int `json:"activityTypeId"`
|
|
|
+ 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"`
|
|
|
+ ActivityState int `json:"activityState"`
|
|
|
}
|
|
|
|
|
|
type ActivityDetail struct {
|
|
|
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"`
|
|
|
- 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"`
|
|
|
+ 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"`
|
|
|
+ IsNewReport int `json:"is_new_report"`
|
|
|
}
|
|
|
|
|
|
|
|
@@ -60,7 +62,7 @@ func GetPageListByWhere(condition string, pars []interface{}, page, limit int, o
|
|
|
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",
|
|
|
+ "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",
|
|
|
}
|
|
|
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) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-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{}).
|
|
|
Select("DISTINCT activity_id").
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
-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
|
|
|
return
|
|
|
}
|
|
|
|
|
|
|
|
|
-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{}).
|
|
|
Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityids).
|
|
|
Order("create_time desc").
|
|
@@ -99,16 +101,15 @@ func GetListByIds(activityids []int, offset , limit int) (activitys []*YbActivit
|
|
|
}
|
|
|
|
|
|
|
|
|
-func GetListCountByIds(activityIds []int) (total int64, err error) {
|
|
|
+func GetListCountByIds(activityIds []int) (total int64, err error) {
|
|
|
err = global.DEFAULT_MYSQL.Model(YbActivity{}).
|
|
|
Where("activity_id in (?) and is_delete = 0 and publish_status = 1", activityIds).
|
|
|
Count(&total).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
-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
|
|
|
return
|
|
|
-}
|
|
|
+}
|