I have the following tables:
- Players: name, phone, score
- Activities: start date, end date, player, game, duration (h)
- Groups: name, players
The activities table track players activities in the games.
My goal is to view the activities in the admin panel.
The activities should be grouped by month, and for each month a list of players with calculated fields like:
- Total durations Hours (sum of all duration for current month)
– Days active
Here is an example of how the view should looks like:
March 2024
- Player A | 40 hours | 5 days
- Player B | 20 hours | 3 days
- Player C | 50 hours | 6 days
September 2024 - Player A | 80 hours | 10 days
- Player B | 50 hours | 6 days
- Player C | 60 hours | 7 days
January 2024 - Player A | 40 hours | 5 days
- Player B | 30 hours | 3 days
- Player C | 100 hours | 20 days