From 5ec0447c56af115cb1c1cd8b76a5d95231bb3917 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 8 May 2022 08:58:04 +0300 Subject: Autocommit at 08.05.2022 @ 08:58 --- src/Services/EventService.cpp | 9 +++++++++ src/Services/EventService.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp index 88a9e08..6388a1e 100644 --- a/src/Services/EventService.cpp +++ b/src/Services/EventService.cpp @@ -179,6 +179,15 @@ List EventService::queryMostWatched(unsigned topN) { return result; } +List EventService::queryInsufficientlyVisited() { + List result; + for (unsigned i = 0; i < events.get_count(); i++) { + if (events[i].get_tickets().get_count() < events[i].get_hall().get_rows() * events[i].get_hall().get_seatsPerRow() / 10) + result.add(events[i]); + } + return result; +} + template bool cond_event_all(const Event& e1, T scrap) { return true; diff --git a/src/Services/EventService.h b/src/Services/EventService.h index 1914c02..0a6a399 100644 --- a/src/Services/EventService.h +++ b/src/Services/EventService.h @@ -35,7 +35,7 @@ public: String createSeatingString(const char* name, const Date& date, unsigned* seatsPerRow); List queryMostWatched(unsigned topN); - void queryInsufficientlyVisited(); + List queryInsufficientlyVisited(); StatusCode reportReservations(const char* name, const Date& date); StatusCode reportBoughtTickets(int hallNumber, const Date& start, const Date& end, bool all = false); -- cgit v1.3.1-26-gb76a