mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Fix pelmeni moment
This commit is contained in:
parent
f2ca6be4d5
commit
5203229e9e
1 changed files with 2 additions and 2 deletions
|
@ -103,7 +103,7 @@ class Poll extends Attachable
|
|||
$option->name = $title;
|
||||
|
||||
$option->votes = $this->getVoterCount($id);
|
||||
$option->pct = $result->totalVotes == 0 ? 0 : (($option->votes / $result->totalVotes) * 100);
|
||||
$option->pct = $result->totalVotes == 0 ? 0 : min(100, floor(($option->votes / $result->totalVotes) * 100));
|
||||
$option->voters = $this->getVoters($id, 1, 10);
|
||||
if(!$user || !$voted)
|
||||
$option->voted = NULL;
|
||||
|
@ -292,4 +292,4 @@ class Poll extends Attachable
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue