mirror of
https://github.com/ZeroDream-CN/SakuraPanel.git
synced 2025-01-12 09:52:52 +08:00
Fix: Date calc bug
This commit is contained in:
parent
3081816189
commit
e1f3a683b3
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user