Changeset 217 for trunk/lib/Vote/DB/Poll/Results.pm
- Timestamp:
- 04/18/09 04:57:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/DB/Poll/Results.pm
r215 r217 135 135 my @results; 136 136 my $abs_maj = $self->absolute_majority; 137 my $wanted_count = $self->info(' choice_count');137 my $wanted_count = $self->info('elected_count'); 138 138 my $voice_count = $self->voices_ballot_count; 139 139 while (my $res = $sth->fetchrow_hashref) { … … 147 147 if($res->{count} == $results[-1]->{count}); 148 148 } 149 if (scalar(@results)) { 150 $res->{order} = ($res->{count} == $results[-1]->{count} 151 ? $results[-1]->{order} 152 : scalar(@results) + 1); 153 } else { $res->{order} = 1 } 149 154 $res->{voices_percent} = $res->{count} / $voice_count * 100 150 155 if($voice_count); # avoid divide by 0
Note: See TracChangeset
for help on using the changeset viewer.