턴 지연 버그 수정. 설문조사 % 막대

This commit is contained in:
2018-05-21 03:51:04 +09:00
parent 742e2e8003
commit e45f3a7d03
2 changed files with 25 additions and 1 deletions
+24
View File
@@ -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'] = "&nbsp;"; }
?>
<?php if($per == 0): ?>
@@ -269,8 +278,15 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
<td>
";
$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'] = "&nbsp;"; }
?>
<?php if($per == 0): ?>
@@ -315,6 +331,7 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
<td align=center>
";
$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'] = "&nbsp;"; }
?>
+1 -1
View File
@@ -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)