5
誰かが私を助けてくれたらと思っていました。Codeigniter - アルファベット順にアクティブなレコードを注文する
モデルに関数を呼び出すAjaxが少しあります。
しかし、私は 'モデル'によって出力を注文することができないようです。
function get_models_by_brand($tree = null)
{
$this->db->select('id, model');
if($tree != NULL){
$this->db->where('brand_id', $tree);
}
$query = $this->db->get('models');
$models = array();
if($query->result()){
foreach ($query->result() as $model) {
$models[$model->id] = $model->model;
}
return $models;
} else {
return FALSE;
}
}
'ます$ this-> DB-> ORDER_BY( 'モデル')'? –