move to 1 table instead of 3 (what was I thinking???)
This commit is contained in:
parent
11127f269d
commit
e5c57bf505
7 changed files with 41 additions and 285 deletions
|
@ -16,7 +16,7 @@ impl Class {
|
|||
let pool = ctx.data::<Pool<Postgres>>().unwrap();
|
||||
|
||||
let sql = format!(
|
||||
"SELECT count(distinct character_id) FROM classes WHERE time > now() - interval '15 minutes' AND class_id = $1 {};",
|
||||
"SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND class_id = $1 {};",
|
||||
filters.sql(),
|
||||
);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ impl Vehicle {
|
|||
let pool = ctx.data::<Pool<Postgres>>().unwrap();
|
||||
|
||||
let sql = format!(
|
||||
"SELECT count(distinct character_id) FROM vehicles WHERE time > now() - interval '15 minutes' AND vehicle_id = $1 {};",
|
||||
"SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND vehicle_id = $1 {};",
|
||||
filters.sql(),
|
||||
);
|
||||
|
||||
|
@ -89,7 +89,7 @@ impl Vehicles {
|
|||
let pool = ctx.data::<Pool<Postgres>>().unwrap();
|
||||
|
||||
let sql = format!(
|
||||
"SELECT count(distinct character_id) FROM vehicles WHERE time > now() - interval '15 minutes' {};",
|
||||
"SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND vehicle_id != 'unknown' {};",
|
||||
self.filters.sql(),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue