Improve handling of returning patrons

This commit is contained in:
Alex Cabal 2022-06-29 18:05:49 -05:00
parent dbefba6b94
commit 32206f3cd7
10 changed files with 61 additions and 55 deletions

View file

@ -49,10 +49,10 @@ class Vote extends PropertiesBase{
}
else{
// Do we already have a vote for this poll, from this user?
if( (Db::Query('
SELECT count(*) as VoteCount from Votes v inner join
if(Db::QueryInt('
SELECT count(*) from Votes v inner join
(select PollItemId from PollItems pi inner join Polls p on pi.PollId = p.PollId) x
on v.PollItemId = x.PollItemId where v.UserId = ?', [$this->UserId]))[0]->VoteCount > 0){
on v.PollItemId = x.PollItemId where v.UserId = ?', [$this->UserId]) > 0){
$error->Add(new Exceptions\VoteExistsException());
}
}