From e1f3a683b3362409b76a2ab1e2e71a2a638b5b17 Mon Sep 17 00:00:00 2001 From: Akkariin Meiko Date: Mon, 20 Jan 2020 10:15:55 +0800 Subject: [PATCH] Fix: Date calc bug --- modules/sign.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/sign.php b/modules/sign.php index 2df735b..55e94f6 100755 --- a/modules/sign.php +++ b/modules/sign.php @@ -45,7 +45,7 @@ if(isset($_GET['sign'])) { $rs = Database::querySingleLine("sign", Array("username" => $_SESSION['user'])); if($rs) { if(isset($rs['signdate'])) { - if(round(time() / 86400) >= (round($rs['signdate'] / 86400) + 1)) { + if(Intval(date("Ymd")) >= Intval(date("Ymd", $rs['signdate'])) + 1) { $totaltraffic = $rs['totaltraffic'] == "" ? "0" : $rs['totaltraffic']; $totalsign = $rs['totalsign'] == "" ? "0" : $rs['totalsign']; Database::update("sign", Array("signdate" => time(), "totaltraffic" => $totaltraffic + $rand, "totalsign" => $totalsign + 1), Array("username" => $_SESSION['user'])); @@ -78,7 +78,7 @@ if(isset($_GET['sign'])) { $signed = false; $ss = Database::querySingleLine("sign", Array("username" => $_SESSION['user'])); if($ss) { - if(isset($ss['signdate']) && round(time() / 86400) < (round($ss['signdate'] / 86400) + 1)) { + if(isset($ss['signdate']) && Intval(date("Ymd")) < Intval(date("Ymd", $ss['signdate'])) + 1) { $signed = true; } } @@ -229,4 +229,4 @@ function sign() { } }); } - \ No newline at end of file +