Я использую laravel 4.2 Как вывести json в порядке убывания?Спасибо.
Ниже мой код:
public function show($id) {
$member = $this->getMember ();
$transition = $member->getTransition ( $id )->first ();
$transition_info = $transition-> transitionInfo;
return ResponseWrapper::toJson ( $transition_info );
}
...
public function index() {
$member = $this->getMember ();
$transitions = $member->getTransitions ();
return ResponseWrapper::toJson ( $transitions );
}
/ * 12/28 обновление * /
Возможно ядолжен измениться в модели ниже?(project / app / models / Member.php)
public function getTransitions()
{
$array = $this->hasMany('Transition', 'payeer_id', 'id')->select($this->transition_index_payeer_column)->get()->all();
$arrayb = $this->hasMany('Transition', 'remitter_id', 'id')->select($this->transition_index_remitter_column)->whereRaw('NOT (card_type_remitter = "focas" and focas_status = "")')->get()->all();
$reuslt = array_merge ( $array, $arrayb );
return $reuslt;
}