Skip to content

Commit

Permalink
solves #180
Browse files Browse the repository at this point in the history
  • Loading branch information
deinelieblings committed Jun 28, 2024
1 parent e814866 commit f49c0a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dao/update_ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func EventStateClosedTicker() {
},
bson.D{{Key: "state.no_income", Value: true}},
}}
filter.Append(bson.E{Key: "$or", Value: confirmedFilter})
filter.Append(confirmedFilter)
filter.EqualString("event.event_state.state", "finished")
pipeline := models.TakingPipeline().Match(filter.Bson()).Pipe
takings := []models.Taking{}
Expand Down
5 changes: 5 additions & 0 deletions models/taking.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ type (
Search string `query:"search"`
CrewID []string `query:"crew_id"`
EventName string `query:"event_name"`
TypeOfEvent []string `query:"type_of_event"`
ArtistName string `query:"artist_name"`
EventState []string `query:"event_state"`
EventEndFrom string `query:"event_end_from"`
EventEndTo string `query:"event_end_to"`
Expand Down Expand Up @@ -110,6 +112,7 @@ func TakingPipeline() *vmdb.Pipeline {
pipe.Lookup(SourceCollection, "_id", "taking_id", "sources")
pipe.LookupUnwind(CrewCollection, "crew_id", "_id", "crew")
pipe.LookupUnwind(EventCollection, "_id", "taking_id", "event")
pipe.LookupList(ArtistCollection, "artist_ids", "_id", "event.artists")
pipe.Append(bson.D{{Key: "$addFields", Value: bson.D{
{Key: "state.wait.amount", Value: bson.D{{Key: "$sum", Value: "$wait.money.amount"}}},
}}})
Expand Down Expand Up @@ -194,7 +197,9 @@ func (i *TakingQuery) PermittedFilter(token *vcapool.AccessToken) bson.D {
filter.LikeString("name", i.Name)
filter.SearchString([]string{"name", "event.name"}, i.Search)
filter.EqualStringList("event.event_state.state", i.EventState)
filter.EqualStringList("event.type_of_event", i.TypeOfEvent)
filter.LikeString("event.name", i.EventName)
filter.LikeString("event.artists.name", i.ArtistName)
filter.GteInt64("event.end_at", i.EventEndFrom)
filter.LteInt64("event.end_at", i.EventEndTo)
status := bson.A{}
Expand Down

0 comments on commit f49c0a0

Please sign in to comment.