mirror of
https://github.com/ZeroDream-CN/SakuraPanel.git
synced 2025-01-12 09:52:52 +08:00
Merge pull request #33 from Daiyangcheng/patch-1
Fix mathematical logic errors in traffic updates
This commit is contained in:
commit
627f9d0128
@ -101,7 +101,7 @@ function updateTraffic($conn, $user, $traffic) {
|
|||||||
mysqli_query($conn, "UPDATE `proxies` SET `status`='0' WHERE `username`='{$user}' AND `status`='2'");
|
mysqli_query($conn, "UPDATE `proxies` SET `status`='0' WHERE `username`='{$user}' AND `status`='2'");
|
||||||
} else {
|
} else {
|
||||||
// 数据库里的当日流量大于统计得到的流量,说明这一天已经过完了,将新的流量计入数据库
|
// 数据库里的当日流量大于统计得到的流量,说明这一天已经过完了,将新的流量计入数据库
|
||||||
$newTraffic = round(($userTraffic - $traffic) / 1024 / 1024, 2);
|
$newTraffic = round(($userTraffic - $traffic / 1024 / 1024), 2);
|
||||||
if($newTraffic < 0) {
|
if($newTraffic < 0) {
|
||||||
$newTraffic = 0;
|
$newTraffic = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user