mirror of
https://github.com/v2board/v2board.git
synced 2025-01-28 08:59:09 +08:00
fix: the display data for surge and surfboard panel remaining traffic
This commit is contained in:
parent
0ca47622a5
commit
95c112a436
@ -76,8 +76,9 @@ class Surfboard
|
|||||||
$download = round($user['d'] / (1024*1024*1024), 2);
|
$download = round($user['d'] / (1024*1024*1024), 2);
|
||||||
$useTraffic = $upload + $download;
|
$useTraffic = $upload + $download;
|
||||||
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
||||||
|
$remainingTraffic = $totalTraffic - $useTraffic;
|
||||||
$expireDate = $user['expired_at'] === NULL ? '长期有效' : date('Y-m-d H:i:s', $user['expired_at']);
|
$expireDate = $user['expired_at'] === NULL ? '长期有效' : date('Y-m-d H:i:s', $user['expired_at']);
|
||||||
$subscribeInfo = "title={$appName}订阅信息, content=上传流量:{$upload}GB\\n下载流量:{$download}GB\\n剩余流量:{$useTraffic}GB\\n套餐流量:{$totalTraffic}GB\\n到期时间:{$expireDate}";
|
$subscribeInfo = "title={$appName}订阅信息, content=上传流量:{$upload}GB\\n下载流量:{$download}GB\\n剩余流量:{$remainingTraffic}GB\\n套餐流量:{$totalTraffic}GB\\n到期时间:{$expireDate}";
|
||||||
$config = str_replace('$subscribe_info', $subscribeInfo, $config);
|
$config = str_replace('$subscribe_info', $subscribeInfo, $config);
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
@ -77,8 +77,9 @@ class Surge
|
|||||||
$download = round($user['d'] / (1024*1024*1024), 2);
|
$download = round($user['d'] / (1024*1024*1024), 2);
|
||||||
$useTraffic = $upload + $download;
|
$useTraffic = $upload + $download;
|
||||||
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
||||||
|
$remainingTraffic = $totalTraffic - $useTraffic;
|
||||||
$expireDate = $user['expired_at'] === NULL ? '长期有效' : date('Y-m-d H:i:s', $user['expired_at']);
|
$expireDate = $user['expired_at'] === NULL ? '长期有效' : date('Y-m-d H:i:s', $user['expired_at']);
|
||||||
$subscribeInfo = "title={$appName}订阅信息, content=上传流量:{$upload}GB\\n下载流量:{$download}GB\\n剩余流量:{$useTraffic}GB\\n套餐流量:{$totalTraffic}GB\\n到期时间:{$expireDate}";
|
$subscribeInfo = "title={$appName}订阅信息, content=上传流量:{$upload}GB\\n下载流量:{$download}GB\\n剩余流量:{$remainingTraffic}GB\\n套餐流量:{$totalTraffic}GB\\n到期时间:{$expireDate}";
|
||||||
$config = str_replace('$subscribe_info', $subscribeInfo, $config);
|
$config = str_replace('$subscribe_info', $subscribeInfo, $config);
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
Loading…
Reference in New Issue
Block a user