- Timestamp:
- Sep 10, 2020, 10:25:07 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r36 r37 159 159 160 160 $Runners = array(); 161 $DbResult = $this->Database->query('SELECT Runner.Id, Runner.ChipNumber, '.161 $DbResult = $this->Database->query('SELECT Runner.Id, Runner.ChipNumber, Runner.Team, '. 162 162 '(SELECT RunnerStat.Distance FROM RunnerStat WHERE (RunnerStat.Runner = Runner.Id) ORDER BY RunnerStat.Distance DESC LIMIT 1) AS Distance '. 163 163 'FROM Runner WHERE Year='.$Year); … … 203 203 'IsFamily' => 0, 204 204 )); 205 $Teams[$Item['TeamId']] = array('Id' => $TeamId, 'Distance' => -1 );205 $Teams[$Item['TeamId']] = array('Id' => $TeamId, 'Distance' => -1, 'Team' => $Item['TeamId']); 206 206 $NextTeamId++; 207 207 } else … … 224 224 $Runners[$Item['ChipNumber']] = array('Id' => $RunnerId, 'Distance' => -1); 225 225 $NextRunnerId++; 226 } else 226 } else { 227 227 $RunnerId = $Runners[$Item['ChipNumber']]['Id']; 228 229 // Update runner team if it was changed 230 if ($Item['TeamId'] != $Runners[$Item['ChipNumber']]['Team'] and array_key_exists($Item['TeamId'], $Teams)) 231 { 232 $Runners[$Item['ChipNumber']]['Team'] = $Item['TeamId']; 233 $Queries[] = $this->Database->GetUpdate('Runner', 'Id='.$RunnerId, array('Team' => $Item['TeamId'])); 234 } 235 } 228 236 229 237 if ($Runners[$Item['ChipNumber']]['Distance'] < $Item['OverallDistance'])
Note:
See TracChangeset
for help on using the changeset viewer.