diff --git a/hwe/index.php b/hwe/index.php index a7512320..f0fde62a 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -2,6 +2,8 @@ namespace sammo; +use sammo\DTO\VoteInfo; + include "lib.php"; include "func.php"; @@ -109,6 +111,16 @@ if (!$otherTextInfo) { } else { $otherTextInfo = join(', ', $otherTextInfo); } + +$lastVoteID = $gameStor->lastVote; +$lastVote = null; +if($lastVoteID){ + $voteStor = KVStorage::getStorage($db, 'vote'); + $lastVote = new VoteInfo($voteStor->getValue("vote_{$voteID}")); + if($lastVote->endDate && $lastVote->endDate < TimeUtil::now()){ + $lastVote = null; + } +} ?> @@ -207,13 +219,11 @@ if (!$otherTextInfo) {