2015-05-04 12 views
2
Array 
(
    [0] => stdClass Object 
     (
      [id] => 16 
      [department_id] => 4 
      [employee_status] => 1 


     ) 

    [1] => stdClass Object 
     (
      [id] => 17 
      [department_id] => 8 
      [employee_status] => 1 
     ) 

) 
+1

你想在實現這個哪種語言? –

+0

除了@NomanUrRehman之外,你到目前爲止還有哪些嘗試? – bit

+0

@NomanUrRehman在php –

回答

2

我發現了一個解決方案,排序對象數組

function cmp($a, $b) { 
    return $b->department_id - $a->department_id; 
} 
$sirtedArray=usort($employeelist, "cmp"); 
+0

@benka謝謝 –