Add isjoined to event info and event list
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -32,7 +32,8 @@ type EventIndexDoc struct {
|
||||
StartTime time.Time `json:"start_time"`
|
||||
EndTime time.Time `json:"end_time"`
|
||||
Thumbnail string `json:"thumbnail"`
|
||||
RequireKyc bool `json:"require_kyc"`
|
||||
EnableKYC bool `json:"enable_kyc"`
|
||||
IsJoined bool `json:"is_joined"`
|
||||
JoinCount int64 `json:"join_count"`
|
||||
CheckinCount int64 `json:"checkin_count"`
|
||||
}
|
||||
@@ -98,7 +99,7 @@ func (self *Event) FastListEvents(ctx context.Context, limit, offset int64) (*[]
|
||||
|
||||
err := Database.WithContext(ctx).
|
||||
Model(&Event{}).
|
||||
Select("event_id", "name", "type", "description", "start_time", "end_time").
|
||||
Select("event_id", "name", "type", "description", "start_time", "end_time", "enable_kyc").
|
||||
Limit(int(limit)).
|
||||
Offset(int(offset)).
|
||||
Scan(&results).Error
|
||||
|
||||
Reference in New Issue
Block a user