| @@ 589-598 (lines=10) @@ | ||
| 586 | if (0 != $team) { |
|
| 587 | $where .= ('' == $where ? ' HAVING' : ' AND').' team = '.$team; |
|
| 588 | } |
|
| 589 | switch ($rankingNumber) { |
|
| 590 | case 1: |
|
| 591 | $order = ' ORDER BY active DESC, level DESC'; |
|
| 592 | break; |
|
| 593 | case 2: |
|
| 594 | $order = ' ORDER BY maxCp DESC, level DESC'; |
|
| 595 | break; |
|
| 596 | default: |
|
| 597 | $order = ' ORDER BY level DESC, active DESC'; |
|
| 598 | } |
|
| 599 | $order .= ', last_seen DESC, name '; |
|
| 600 | $limit = ' LIMIT '.($page * 10).',10 '; |
|
| 601 | $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 |
|
| @@ 590-599 (lines=10) @@ | ||
| 587 | if (0 != $team) { |
|
| 588 | $where .= ('' == $where ? ' HAVING' : ' AND').' team = '.$team; |
|
| 589 | } |
|
| 590 | switch ($rankingNumber) { |
|
| 591 | case 1: |
|
| 592 | $order = ' ORDER BY active DESC, level DESC'; |
|
| 593 | break; |
|
| 594 | case 2: |
|
| 595 | $order = ' ORDER BY maxCp DESC, level DESC'; |
|
| 596 | break; |
|
| 597 | default: |
|
| 598 | $order = ' ORDER BY level DESC, active DESC'; |
|
| 599 | } |
|
| 600 | $order .= ', last_seen DESC, name '; |
|
| 601 | $limit = ' LIMIT 10 OFFSET '.($page * 10); |
|
| 602 | $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 |
|