From e45f3a7d038370d45529fd2d6c5fc5087c6964f4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 21 May 2018 03:51:04 +0900 Subject: [PATCH] =?UTF-8?q?=ED=84=B4=20=EC=A7=80=EC=97=B0=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95.=20=EC=84=A4=EB=AC=B8=EC=A1=B0?= =?UTF-8?q?=EC=82=AC=20%=20=EB=A7=89=EB=8C=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_vote.php | 24 ++++++++++++++++++++++++ hwe/func.php | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/hwe/a_vote.php b/hwe/a_vote.php index 2945961b..92505fb7 100644 --- a/hwe/a_vote.php +++ b/hwe/a_vote.php @@ -230,8 +230,17 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) { $nationVote[$nation][$ownVote] += $cnt; } + $totalPer = 0; for ($i=0; $i < $voteTypeCount; $i++) { $per = round(($totalVote[$i]??0) * 100 / $memCount, 1); + if($i == $voteTypeCount-1){ + $per = 100-$totalPer; + } + else{ + $totalPer += $per; + } + + // if($per < 5) { $vote['cnt'] = " "; } ?> @@ -269,8 +278,15 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) { "; + $totalPer = 0; for ($i=0; $i < $voteTypeCount; $i++) { $per = round(Util::array_get($nationVote[0][$i], 0) / $memCount * 100, 1); + if($i == $voteTypeCount-1){ + $per = 100-$totalPer; + } + else{ + $totalPer += $per; + } // if($per < 5) { $vote['cnt'] = " "; } ?> @@ -315,6 +331,7 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) { "; + $totalPer = 0; for ($k=0; $k < $voteTypeCount; $k++) { if($memCount == 0){ $per = 0; @@ -322,6 +339,13 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) { else{ $per = round($nationVote[$nation['nation']][$k]??0 / $memCount * 100, 1); } + + if($i == $voteTypeCount-1){ + $per = 100-$totalPer; + } + else{ + $totalPer += $per; + } // if($per < 5) { $vote['cnt'] = " "; } ?> diff --git a/hwe/func.php b/hwe/func.php index b735de65..3fb372b4 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1440,7 +1440,7 @@ function checkDelay() { $minute = $iter * $term; $newTurntime = $turntime->add(new \DateInterval("PT{$minute}M")); $newNextTurntime = $turntime->add(new \DateInterval("PT{$term}M")); - $gameStor->turntime = $newTurntime; + $gameStor->turntime = $newTurntime->format('Y-m-d H:i:s'); $db->update('general', [ 'turntime'=> $db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)