Changeset 38
- Timestamp:
- Sep 10, 2020, 10:45:41 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r37 r38 203 203 'IsFamily' => 0, 204 204 )); 205 $Teams[$Item['TeamId']] = array('Id' => $TeamId, 'Distance' => -1 , 'Team' => $Item['TeamId']);205 $Teams[$Item['TeamId']] = array('Id' => $TeamId, 'Distance' => -1); 206 206 $NextTeamId++; 207 207 } else … … 222 222 'Year' => $Year, 223 223 )); 224 $Runners[$Item['ChipNumber']] = array('Id' => $RunnerId, 'Distance' => -1 );224 $Runners[$Item['ChipNumber']] = array('Id' => $RunnerId, 'Distance' => -1, 'Team' => $TeamId); 225 225 $NextRunnerId++; 226 226 } else { … … 228 228 229 229 // Update runner team if it was changed 230 if ($Item['TeamId'] != $Runners[$Item['ChipNumber']]['Team'] and array_key_exists($Item['TeamId'], $Teams)) 230 $OldRunnerTeamId = $Runners[$Item['ChipNumber']]['Team']; 231 if ($Item['TeamId'] == null) 231 232 { 232 $Runners[$Item['ChipNumber']]['Team'] = $Item['TeamId']; 233 $Queries[] = $this->Database->GetUpdate('Runner', 'Id='.$RunnerId, array('Team' => $Item['TeamId'])); 233 $NewRunnerTeamId = null; 234 } else 235 { 236 $NewRunnerTeamId = $Teams[$Item['TeamId']]['Id']; 237 } 238 if ($OldRunnerTeamId != $NewRunnerTeamId) 239 { 240 $Runners[$Item['ChipNumber']]['Team'] = $NewRunnerTeamId; 241 $Queries[] = $this->Database->GetUpdate('Runner', 'Id='.$RunnerId, array('Team' => $NewRunnerTeamId)); 234 242 } 235 243 }
Note:
See TracChangeset
for help on using the changeset viewer.