| @@ 617-626 (lines=10) @@ | ||
| 614 | if (0 != $team) { |
|
| 615 | $where .= ('' == $where ? ' HAVING' : ' AND').' team = '.$team; |
|
| 616 | } |
|
| 617 | switch ($rankingNumber) { |
|
| 618 | case 1: |
|
| 619 | $order = ' ORDER BY active DESC, level DESC'; |
|
| 620 | break; |
|
| 621 | case 2: |
|
| 622 | $order = ' ORDER BY maxCp DESC, level DESC'; |
|
| 623 | break; |
|
| 624 | default: |
|
| 625 | $order = ' ORDER BY level DESC, active DESC'; |
|
| 626 | } |
|
| 627 | $order .= ', last_seen DESC, name '; |
|
| 628 | $limit = ' LIMIT '.($page * 10).',10 '; |
|
| 629 | $req = 'SELECT gd.owner_name AS name, MAX(owner_level) AS level, MAX(cp) AS maxCp, MAX(active) AS active, MAX(team) AS team, FROM_UNIXTIME(MAX(last_modified)) as last_seen |
|
| @@ 618-627 (lines=10) @@ | ||
| 615 | if (0 != $team) { |
|
| 616 | $where .= ('' == $where ? ' HAVING' : ' AND').' team = '.$team; |
|
| 617 | } |
|
| 618 | switch ($rankingNumber) { |
|
| 619 | case 1: |
|
| 620 | $order = ' ORDER BY active DESC, level DESC'; |
|
| 621 | break; |
|
| 622 | case 2: |
|
| 623 | $order = ' ORDER BY maxCp DESC, level DESC'; |
|
| 624 | break; |
|
| 625 | default: |
|
| 626 | $order = ' ORDER BY level DESC, active DESC'; |
|
| 627 | } |
|
| 628 | $order .= ', last_seen DESC, name '; |
|
| 629 | $limit = ' LIMIT 10 OFFSET '.($page * 10); |
|
| 630 | $req = 'SELECT gd.owner_name AS name, MAX(owner_level) AS level, MAX(cp) AS maxCp, MAX(active) AS active, MAX(team) AS team, TO_TIMESTAMP(MAX(last_modified)) as last_seen |
|