Closed guille10k closed 2 years ago
Please check this query:
SELECT Run
.position
, Phase
.name
, Progression
.boats
FROM kdataspo_cbca
.Run
LEFT JOIN kdataspo_cbca
.Event
e
ON Run
.event
=e
.id
LEFT JOIN kdataspo_cbca
.Boat
b
ON Run
.boat
=b
.id
LEFT JOIN kdataspo_cbca
.Athlete
ath
ON b
.person
=ath
.id
LEFT JOIN kdataspo_cbca
.Phase
ON e
.phase
=Phase
.id
LEFT JOIN kdataspo_cbca
.Race
ON e
.race
=Race
.id
LEFT JOIN kdataspo_cbca
.Progression
ON kdataspo_cbca
.Race
.progression
=kdataspo_cbca
.Progression
.progressionMode
AND e
.phase
=kdataspo_cbca
.Progression
.phase
AND e
.category
=kdataspo_cbca
.Progression
.category
AND kdataspo_cbca
.Progression
.raceType
=kdataspo_cbca
.Race
.raceType
AND YEAR(kdataspo_cbca.Race.date) BETWEEN kdataspo_cbca.Progression.season0 AND kdataspo_cbca
.Progression
.seasonF
WHERE (e
.race
= "199" AND e
.category
= b
.boatKind
AND b
.id
= "223" AND (Run
.position
> Progression
.boats
OR Phase
.name
LIKE "%final%"))
on the last WHERE it is missing e.id = {id of the completed event}
Please check
Ok, better. But we will change the query to something simpler, because we are not getting all the results possible.
SELECT Run.position, Phase.name FROM kdataspo_cbca.Run LEFT JOIN kdataspo_cbca.Event e ON Run.event=e.id LEFT JOIN kdataspo_cbca.Boat b ON Run.boat=b.id LEFT JOIN kdataspo_cbca.Athlete ath ON b.person=ath.id LEFT JOIN kdataspo_cbca.Phase ON e.phase=Phase.id LEFT JOIN kdataspo_cbca.Race ON e.race=Race.id WHERE (e.race = "199" AND e.category = b.boatKind AND b.id = "223")
And the notification has to be a link to the results
Check it
Ok, now it's a link to the results, but i meant to the specific results. If it is a result from Semi, WC1 of the World Championships Bratislava, it has to open the results from Semi, WC1 of the World Championships Bratislava.
Done in local. We will push it to live on next version
Good
When an event is completed, notify only about that event, not all the results from the whole race.