mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: subscribe info
This commit is contained in:
parent
45fd04137b
commit
4dc6d29076
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Client;
|
|||||||
use App\Http\Controllers\Client\Protocols\General;
|
use App\Http\Controllers\Client\Protocols\General;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Services\ServerService;
|
use App\Services\ServerService;
|
||||||
|
use App\Utils\Helper;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Services\UserService;
|
use App\Services\UserService;
|
||||||
|
|
||||||
@ -40,9 +41,9 @@ class ClientController extends Controller
|
|||||||
{
|
{
|
||||||
if (!isset($servers[0])) return;
|
if (!isset($servers[0])) return;
|
||||||
if (!(int)config('v2board.show_info_to_server_enable', 0)) return;
|
if (!(int)config('v2board.show_info_to_server_enable', 0)) return;
|
||||||
$useTraffic = round($user['u'] / (1024*1024*1024), 2) + round($user['d'] / (1024*1024*1024), 2);
|
$useTraffic = $user['u'] + $user['d'];
|
||||||
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
$totalTraffic = $user['transfer_enable'];
|
||||||
$remainingTraffic = $totalTraffic - $useTraffic;
|
$remainingTraffic = Helper::trafficConvert($totalTraffic - $useTraffic);
|
||||||
$expiredDate = $user['expired_at'] ? date('Y-m-d', $user['expired_at']) : '长期有效';
|
$expiredDate = $user['expired_at'] ? date('Y-m-d', $user['expired_at']) : '长期有效';
|
||||||
$userService = new UserService();
|
$userService = new UserService();
|
||||||
$resetDay = $userService->getResetDay($user);
|
$resetDay = $userService->getResetDay($user);
|
||||||
@ -55,7 +56,7 @@ class ClientController extends Controller
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
array_unshift($servers, array_merge($servers[0], [
|
array_unshift($servers, array_merge($servers[0], [
|
||||||
'name' => "剩余流量:{$remainingTraffic} GB",
|
'name' => "剩余流量:{$remainingTraffic}",
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user