Plugin Directory

Changeset 1977710


Ignore:
Timestamp:
11/20/2018 10:24:51 PM (7 years ago)
Author:
martindrapeau
Message:

Standings: bug fix on football team rankings

Location:
amilia-store/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • amilia-store/trunk/amilia-store.php

    r1977604 r1977710  
    66Author: Martin Drapeau <martin.drapeau@amilia.com>
    77Copyright: 2014-2018 Amilia
    8 Version: 2.8.7
     8Version: 2.8.8
    99Author URI: http://www.amilia.com/
    1010License: Apache License 2.0
  • amilia-store/trunk/shortcodes/amilia-store-standings.php

    r1977603 r1977710  
    237237                teams.push(team);
    238238            }
    239             teams.sort(function(a, b) {
    240                 if (a.Pts == b.Pts) {
    241                     if (a.F == b.F) {
     239            if (sport == 'football')
     240                teams.sort(function(a, b) {
     241                    if (a.Pts == b.Pts) {
    242242                        if (a.GD == b.GD) return 0;
    243243                        return a.GD < b.GD ? 1 : -1;
    244244                    }
    245                     return a.F < b.F ? 1 : -1;
    246                 }
    247                 return a.Pts < b.Pts ? 1 : -1;
    248             });
     245                    return a.Pts < b.Pts ? 1 : -1;
     246                });
     247            else
     248                teams.sort(function(a, b) {
     249                    if (a.Pts == b.Pts) {
     250                        if (a.F == b.F) {
     251                            if (a.GD == b.GD) return 0;
     252                            return a.GD < b.GD ? 1 : -1;
     253                        }
     254                        return a.F < b.F ? 1 : -1;
     255                    }
     256                    return a.Pts < b.Pts ? 1 : -1;
     257                });
    249258
    250259            var html = '';
Note: See TracChangeset for help on using the changeset viewer.