离子中的上升和下降

I have a problem in ionic.

so, when i choose the select list in "A-Z", it means ascending.

enter image description here

and when i click the button, it should go to another state that show my list.

enter image description here

if A-Z is choosen, the "goal futsal " should be number 1 right?. how can i do that? what's wrong with my code. Please help. thank you.

here is controller that i use in my code.

.controller('cariCtrl',function($scope,$http,$state,Cari){
   $scope.cari = function(input){
   Cari.setDaerah(input.daerah);
   Cari.setNama(input.nama);
   Cari.setUrut(input.urut);
   $state.go('back.list');
  }
})
  .controller('listCtrl',function($scope,$http,$state,$ionicHistory,Cari){
  $scope.user = [];
  $scope.lapangan = [];

  $scope.goBack = function(){
      $state.go('menu.cari', {}, {
          reload: true
      });
  }
  $http({
      method: 'POST',
      data:{
          daerah: Cari.getDaerah(),
          nama: Cari.getNama(),
          urut: Cari.getUrut()
      },
      url: "http://localhost/TA2/admin/app/getSearchLapangan.php"
  }).success(function(data){
      $scope.lapangan = data;
  }).error(function(data, status,headers,config) {
      alert(status);
      alert(headers);
  }); 
})

in app.js, i add this :

.factory('Cari', function(){
   var data = {
   daerah: '',
   nama: '',
   urut: ''
 };
 return {
    getDaerah: function(){
    return data.daerah;
   },
    setDaerah: function(pdaerah){
    data.daerah = pdaerah;
   },
    getNama: function(){
    return data.nama;
   },
    setNama: function(pnama){
    data.nama = pnama;
   },
    getUrut: function(){
    return data.nama;
   },
     setUrut: function(purut){
     data.urut = purut;
    }
   };
 })

The sql query is like this:

$daerah = $objData->daerah;
$nama = $objData->nama;
$urut = $objData->urut;
$SQL = "";
if ($urut == 0) {
   $SQL = "SELECT L.*, (SELECT path FROM gambar G WHERE G.id_lapangan = L.id_lapangan LIMIT 1) as path from lapangan L WHERE daerah LIKE '" . $daerah . "%' AND nama LIKE '" . $nama . "%' ORDER BY nama ASC;";
} else {
   $SQL = "SELECT L.*, (SELECT path FROM gambar G WHERE G.id_lapangan = L.id_lapangan LIMIT 1) as path from lapangan L WHERE daerah LIKE '" . $daerah . "%' AND nama LIKE '" . $nama . "%' ORDER BY nama DESC;";
}

$result = mysql_query($SQL, $link);
$array = array();
$counter = 0;
while ($row = mysql_fetch_array($result)) {
  $array[$counter] = $row;
  $counter++;
}
echo json_encode($array);

Here is my view :

<label class="item item-select">
<select style="right: auto;" ng-model="input.urut">
   <option value="">Silahkan Pilih Urutan</option>
   <option value="0">A-Z</option>
   <option value="1">Z-A</option>
</select>
</label>
<button class="button button-block button-positive" ng-click="cari(input)">Cari</button>

by the way, i use php. Please help me.

You can set Ascending and Descending order list in Ionic

<label class="item item-select">
     <select ng-model="input.urut" ng-change="onChange(input.urut)">
       <option value="">Silahkan Pilih Urutan</option>
       <option value="0">A-Z</option>
       <option value="1">Z-A</option>
     </select>
</label>
<div class="list">
    <a ng-repeat="item in items | orderBy : 'album' : flag" href="#" class="item item-thumbnail-left">
        <h2>{{ item.album }}</h2>
        <h4>{{ item.artist }}</h4>
    </a>
</div>

and add in your controller

$scope.flag = false;
$scope.onChange = function(urut){
    if(urut == 0){
       $scope.flag = false;
    }else{
        $scope.flag = true;
     }
}

Updated Example