Skip to content

Commit 8813120

Browse files
authored
Merge pull request #928 from datanfr/participation-ranking
Fix MP participation on En Chiffres page
2 parents 1fde9d3 + 96d2799 commit 8813120

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

application/controllers/Stats.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ public function index(){
6565
)
6666
);
6767
}
68-
$data['mps_participation'] = $this->stats_model->get_mps_participation_solennels(legislature_current());
68+
69+
$data['n_sps'] = $this->votes_model->get_n_votes(legislature_current(), NULL, NULL, 'SPS') ?? 0;
70+
$data['mps_participation'] = ($data['n_sps'] > 10)
71+
? $this->stats_model->get_mps_participation_solennels(legislature_current())
72+
: $this->stats_model->get_mps_participation();
73+
6974
if ($data['mps_participation']) {
7075
$data['mps_participation_first'] = array_slice($data['mps_participation'], 0, 3);
7176
$data['mps_participation_last'] = array_slice($data['mps_participation'], -3);

0 commit comments

Comments
 (0)