Skip to content

Commit

Permalink
Merge pull request #292 from datanfr/feature-comparison-stats-mps
Browse files Browse the repository at this point in the history
Correction & change function name
  • Loading branch information
remikel authored Sep 29, 2021
2 parents 00d58ce + 1dc40e3 commit a760a2a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion application/controllers/Deputes.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public function individual($nameUrl, $departement) {
// Historique du député
$data['depute']['datePriseFonctionLettres'] = utf8_encode(strftime('%B %Y', strtotime($data['depute']['datePriseFonction'])));
$data['mandat_edito'] = $this->depute_edito->get_nbr_lettre($data['depute']['mandatesN']);
$data['history_average'] = round($this->deputes_model->get_history_all_mps($mpId));
$data['history_average'] = round($this->deputes_model->get_average_length_as_mp($mpId));
$data['history_edito'] = $this->depute_edito->history(round($data['depute']['mpLength']/365), $data['history_average']);
$data['mandats'] = $this->deputes_model->get_historique_mandats($mpId);
$data['mandatsReversed'] = array_reverse($data['mandats']);
Expand Down
2 changes: 1 addition & 1 deletion application/models/Depute_edito.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function history($mp, $average){
return 'moins que la moyenne';
} elseif($mp > $average){
return 'plus que la moyenne';
} elseif($mp == $average){
} else {
return 'autant que la moyenne';
}
}
Expand Down
2 changes: 1 addition & 1 deletion application/models/Deputes_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function get_other_deputes_legislature($nameLast, $depute_uid, $legislatu
return $this->db->query($sql, array($depute_uid, $legislature, $nameLast))->result_array();
}

public function get_history_all_mps($legislature){
public function get_average_length_as_mp($legislature){
$this->db->select('length');
$result = $this->db->get('history_mps_average', 1)->row_array();
return $result['length'];
Expand Down

0 comments on commit a760a2a

Please sign in to comment.