Changeset 18 for trunk


Ignore:
Timestamp:
Sep 6, 2019, 9:00:35 AM (5 years ago)
Author:
chronos
Message:
  • Fixed: Update name of unnamed teams which were added during runner insertion.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r17 r18  
    9393  function QueryRunners($Category, $Page = 0, $TeamId = null, $Query = null, $StartNumber = null, $Count = null)
    9494  {
    95       $URL = 'http://leaderboard.teribear.cz/Home/GetRunners?category='.$Category;
     95      $URL = 'https://registrace.teribear.cz/Leaderboard/Home/GetRunners?category='.$Category;
    9696      if ($Page != 0) $URL .= '&page='.$Page;
    9797      if ($TeamId != null) $URL .= '&teamId='.$TeamId;
     
    159159
    160160    $Teams = array();
    161     $DbResult = $this->Database->query('SELECT Team.Id, Team.WebId, '.
     161    $DbResult = $this->Database->query('SELECT Team.Id, Team.WebId, Team.Name, '.
    162162      '(SELECT TeamStat.Distance FROM TeamStat WHERE (TeamStat.Team = Team.Id) ORDER BY TeamStat.Distance DESC LIMIT 1) AS Distance '.
    163163      'FROM Team WHERE Year='.$Year);
     
    240240          $TeamId = $Teams[$Item['GroupId']]['Id'];
    241241
     242        // Update missing team names
     243        if ($Teams['Name'] == "")
     244        {
     245          $Queries[] = $this->Database->GetUpdate('Team', 'Id='.$Team['Id'], array('Name' => $Item['Name']));
     246          $Teams['Name'] = $Item['Name'];
     247          echo($Team['Name'].' ');
     248        }
     249
    242250        if ($Teams[$Item['GroupId']]['Distance'] < $Item['OverallDistance'])
    243251        $Queries[] = $this->Database->GetInsert('TeamStat', array(
Note: See TracChangeset for help on using the changeset viewer.