Skip to content

Commit

Permalink
Merge pull request #928 from datanfr/participation-ranking
Browse files Browse the repository at this point in the history
Fix MP participation on En Chiffres page
  • Loading branch information
awenig authored Feb 9, 2025
2 parents 1fde9d3 + 96d2799 commit 8813120
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/controllers/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public function index(){
)
);
}
$data['mps_participation'] = $this->stats_model->get_mps_participation_solennels(legislature_current());

$data['n_sps'] = $this->votes_model->get_n_votes(legislature_current(), NULL, NULL, 'SPS') ?? 0;
$data['mps_participation'] = ($data['n_sps'] > 10)
? $this->stats_model->get_mps_participation_solennels(legislature_current())
: $this->stats_model->get_mps_participation();

if ($data['mps_participation']) {
$data['mps_participation_first'] = array_slice($data['mps_participation'], 0, 3);
$data['mps_participation_last'] = array_slice($data['mps_participation'], -3);
Expand Down

0 comments on commit 8813120

Please sign in to comment.