Compare commits
No commits in common. "323f6da2017e44e67816d98b40c5c6846133e123" and "248ab95ae933f8612f253d74420f0ae51cf77927" have entirely different histories.
323f6da201
...
248ab95ae9
@ -58,25 +58,11 @@ WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND b.name != '
|
|||||||
.fetch_one(db)
|
.fetch_one(db)
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get::<i64, usize>(0) as i32;
|
.get::<i64, usize>(0);
|
||||||
|
|
||||||
let rowed_km_guests = sqlx::query(&format!(
|
|
||||||
"
|
|
||||||
SELECT CAST(SUM(l.distance_in_km) AS INTEGER) AS rowed_km
|
|
||||||
FROM user u
|
|
||||||
INNER JOIN rower r ON u.id = r.rower_id
|
|
||||||
INNER JOIN logbook l ON r.logbook_id = l.id
|
|
||||||
WHERE u.is_guest = 1 AND l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%';
|
|
||||||
"
|
|
||||||
))
|
|
||||||
.fetch_one(db)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.get::<i64, usize>(0) as i32;
|
|
||||||
|
|
||||||
Stat {
|
Stat {
|
||||||
name: "Gäste".into(),
|
name: "Gäste".into(),
|
||||||
rowed_km: rowed_km + rowed_km_guests,
|
rowed_km: rowed_km as i32,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user