Changeset 213 for trunk/lib/Vote/DB/Poll/Results.pm
- Timestamp:
- 04/16/09 20:47:17 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/DB/Poll/Results.pm
r195 r213 81 81 q{ 82 82 select count(ballot.id), value from 83 (select ballot.id, coalesce(corrected, ballot_map.to, value) as "value" from ballot 83 ( 84 select NULL as id, label as value from choice where poll = ? 85 union 86 select ballot.id, coalesce(corrected, ballot_map.to, value) as "value" from ballot 84 87 } . ($nonull ? '' : ' left ') . q{ 85 88 join ballot_item 86 89 on ballot.id = ballot_item.id 87 90 left join ballot_map on ballot.poll = ballot_map.poll and ballot_map.from = ballot_item.value 88 where ballot.poll = ? and (invalid = 'false' or invalid is null) 91 where ballot.poll = ? and (invalid = 'false' or invalid is null 92 ) 89 93 group by ballot.id, coalesce(corrected, ballot_map.to, value)) as ballot 90 94 group by value … … 92 96 } 93 97 ); 94 $sth->execute($self->voteid );98 $sth->execute($self->voteid, $self->voteid); 95 99 my @results; 96 100 while (my $res = $sth->fetchrow_hashref) {
Note: See TracChangeset
for help on using the changeset viewer.