mirror of
https://github.com/indig0fox/Arma3-AttendanceTracker.git/
synced 2025-12-08 09:51:47 -06:00
add null disconnect handling for query
This commit is contained in:
33
README.md
33
README.md
@@ -1,4 +1,4 @@
|
|||||||
# 17th-attendanceTracker
|
# Arma 3 Attendance Tracker
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
@@ -71,13 +71,32 @@ Finally, copy `config.example.json` to `config.json` and update it with your dat
|
|||||||
|
|
||||||
### Show missions with attendance
|
### Show missions with attendance
|
||||||
|
|
||||||
This will retrieve a view showing all missions with attendance data, sorted by the most recent mission joins first.
|
This will retrieve a view showing all missions with attendance data, sorted by the most recent mission joins first. Mission events without a mission disconnect_time (due to server crash or in-progress mission) will be ignored.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
select a.server_profile as Server, a.briefing_name as "Mission Name", a.mission_start as "Start Time", b.display_name as "World", c.profile_name as "Player Name", c.player_uid as "Player UID", TIMESTAMPDIFF(MINUTE, c.join_time, c.disconnect_time) as "Play Time (m)", c.join_time as "Join Time", c.disconnect_time as "Leave Time"
|
select
|
||||||
|
a.server_profile as Server,
|
||||||
|
a.briefing_name as "Mission Name",
|
||||||
|
a.mission_start as "Start Time",
|
||||||
|
b.display_name as "World",
|
||||||
|
c.profile_name as "Player Name",
|
||||||
|
c.player_uid as "Player UID",
|
||||||
|
TIMESTAMPDIFF(
|
||||||
|
MINUTE,
|
||||||
|
c.join_time,
|
||||||
|
c.disconnect_time
|
||||||
|
) as "Play Time (m)",
|
||||||
|
c.join_time as "Join Time",
|
||||||
|
c.disconnect_time as "Leave Time"
|
||||||
from missions a
|
from missions a
|
||||||
LEFT JOIN worlds b ON a.world_id = b.id
|
LEFT JOIN worlds b ON a.world_id = b.id
|
||||||
LEFT JOIN attendance c ON a.mission_hash = c.mission_hash
|
LEFT JOIN attendance c ON a.mission_hash = c.mission_hash
|
||||||
where c.event_type = 'Mission' AND TIMESTAMPDIFF(MINUTE, c.join_time, c.disconnect_time) > 0
|
where
|
||||||
order by c.join_time desc;
|
c.event_type = 'Mission'
|
||||||
|
AND c.disconnect_time IS NOT NULL
|
||||||
|
AND TIMESTAMPDIFF(
|
||||||
|
MINUTE,
|
||||||
|
c.join_time,
|
||||||
|
c.disconnect_time
|
||||||
|
) > 0
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user