|
@ -11,6 +11,7 @@ const NewVoteActivityTableName = TableNamePrefix + "new_vote_activity" |
|
|
type NewVoteActivity struct { |
|
|
type NewVoteActivity struct { |
|
|
Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"` |
|
|
Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"` |
|
|
ActivityId int64 `json:"activity_id" xorm:"not null comment('互动id') INT(11)"` |
|
|
ActivityId int64 `json:"activity_id" xorm:"not null comment('互动id') INT(11)"` |
|
|
|
|
|
Arch int `json:"arch" xorm:"not null default 0 comment('归档') INT(11)"` |
|
|
VoteActivityLadders []*NewVoteActivityLadder `json:"vote_activity_ladders" xorm:"-"` |
|
|
VoteActivityLadders []*NewVoteActivityLadder `json:"vote_activity_ladders" xorm:"-"` |
|
|
Theme string `json:"theme" xorm:"not null default('') comment('投票主题') VARCHAR(255)"` |
|
|
Theme string `json:"theme" xorm:"not null default('') comment('投票主题') VARCHAR(255)"` |
|
|
JoinWay string `json:"join_way" xorm:"not null comment('参与方式说明') TEXT"` |
|
|
JoinWay string `json:"join_way" xorm:"not null comment('参与方式说明') TEXT"` |
|
@ -63,9 +64,9 @@ func UpdateVoteStatusByActivityId(aid int64) (int64, error) { |
|
|
Update(&NewVoteActivity{VoteStatus: define.StatusNotBegin}) |
|
|
Update(&NewVoteActivity{VoteStatus: define.StatusNotBegin}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func GetVoteListByActivityId(activityId interface{}) ([]*NewVoteActivity, error) { |
|
|
|
|
|
|
|
|
func GetVoteListByActivityId(activityId, archId interface{}) ([]*NewVoteActivity, error) { |
|
|
votes := make([]*NewVoteActivity, 0) |
|
|
votes := make([]*NewVoteActivity, 0) |
|
|
err := core.GetXormAuto().Where("is_delete=0 and activity_id=?", activityId). |
|
|
|
|
|
|
|
|
err := core.GetXormAuto().Where("is_delete=0 and activity_id=? and arch_id=?", activityId, archId). |
|
|
Asc("created_at").Find(&votes) |
|
|
Asc("created_at").Find(&votes) |
|
|
return votes, err |
|
|
return votes, err |
|
|
} |
|
|
} |