私はCodeigniterのクエリに取り組んでいます。私はそれをきれいに保つために努力しています。私はまだフィールドのほとんどを追加していないし、特にselect_sumで扱いにくくなっているのがわかります。Codeigniter Query Chaining
よりクリーンな方法で記述したり、組み合わせる方法はありますか?
$this->db->select('Map');
$this->db->select_sum('Kills')->select_sum('Deaths')->select_sum('Win')->select_sum('Loss')->select_sum('Win + Loss', 'GP');
$this->db->from('games');
$this->db->where('Name', $player_name);
$this->db->join('players', 'players.PlayerID = games.PlayerID');
$this->db->join('gameinfo', 'games.GameID = gameinfo.GameID');
$this->db->group_by('Map');
$this->db->order_by('Kills', "desc");
$this->db->limit(10);
$query = $this->db->get();
return $query->result_array();
は私にきれいなルックスより読みやすいです! –