Skip to content

Commit

Permalink
Sorting of villages
Browse files Browse the repository at this point in the history
+Fixed sorting of villages in the profile overview
of the player and in the side menu of the village
list (multivillage). Reduced to the real Travian.
  • Loading branch information
Vladyslav committed Aug 31, 2018
1 parent 7d14953 commit baf38dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GameEngine/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ function getProfileVillages($uid, $mode = 0, $use_cache = true) {

switch ($mode) {
// by owner ID
case 0: $q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE owner IN(".implode(', ', $uid).") ORDER BY capital DESC,pop DESC";
case 0: $q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE owner IN(".implode(', ', $uid).") ORDER BY pop DESC";
break;

// capital villages where owner is a real player (i.e. not Natars etc.)
Expand Down Expand Up @@ -7796,7 +7796,7 @@ function editSlotFarm($eid, $lid, $oldLid, $owner, $wref, $x, $y, $dist, $t1, $t
// no need to cache this method
function getArrayMemberVillage($uid) {
list($uid) = $this->escape_input((int) $uid);
$q = 'SELECT a.wref, a.name, b.x, b.y from '.TB_PREFIX.'vdata AS a left join '.TB_PREFIX.'wdata AS b ON b.id = a.wref where owner = '.$uid.' order by capital DESC,pop DESC';
$q = 'SELECT a.wref, a.name, b.x, b.y from '.TB_PREFIX.'vdata AS a left join '.TB_PREFIX.'wdata AS b ON b.id = a.wref where owner = '.$uid.' ORDER BY name ASC';
$result = mysqli_query($this->dblink,$q);
$array = $this->mysqli_fetch_all($result);
return $array;
Expand Down

1 comment on commit baf38dc

@velhbxtyrj
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously it looked like this:

1

Now it looks like this:

default

Please sign in to comment.