mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
feature: i18n
This commit is contained in:
parent
c984fa2e0b
commit
393680c963
@ -73,10 +73,12 @@ class ShadowsocksTidalabController extends Controller
|
|||||||
Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_ONLINE_USER', $server->id), count($data), 3600);
|
Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_ONLINE_USER', $server->id), count($data), 3600);
|
||||||
$serverService = new ServerService();
|
$serverService = new ServerService();
|
||||||
$userService = new UserService();
|
$userService = new UserService();
|
||||||
|
DB::beginTransaction();
|
||||||
foreach ($data as $item) {
|
foreach ($data as $item) {
|
||||||
$u = $item['u'] * $server->rate;
|
$u = $item['u'] * $server->rate;
|
||||||
$d = $item['d'] * $server->rate;
|
$d = $item['d'] * $server->rate;
|
||||||
if (!$userService->trafficFetch((float)$u, (float)$d, (int)$item['user_id'])) {
|
if (!$userService->trafficFetch((float)$u, (float)$d, (int)$item['user_id'])) {
|
||||||
|
DB::rollBack();
|
||||||
return response([
|
return response([
|
||||||
'ret' => 0,
|
'ret' => 0,
|
||||||
'msg' => 'user fetch fail'
|
'msg' => 'user fetch fail'
|
||||||
@ -92,6 +94,7 @@ class ShadowsocksTidalabController extends Controller
|
|||||||
'trojan'
|
'trojan'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
return response([
|
return response([
|
||||||
'ret' => 1,
|
'ret' => 1,
|
||||||
|
@ -74,10 +74,12 @@ class TrojanTidalabController extends Controller
|
|||||||
Cache::put(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server->id), count($data), 3600);
|
Cache::put(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server->id), count($data), 3600);
|
||||||
$serverService = new ServerService();
|
$serverService = new ServerService();
|
||||||
$userService = new UserService();
|
$userService = new UserService();
|
||||||
|
DB::beginTransaction();
|
||||||
foreach ($data as $item) {
|
foreach ($data as $item) {
|
||||||
$u = $item['u'] * $server->rate;
|
$u = $item['u'] * $server->rate;
|
||||||
$d = $item['d'] * $server->rate;
|
$d = $item['d'] * $server->rate;
|
||||||
if (!$userService->trafficFetch($u, $d, $item['user_id'])) {
|
if (!$userService->trafficFetch($u, $d, $item['user_id'])) {
|
||||||
|
DB::rollBack();
|
||||||
return response([
|
return response([
|
||||||
'ret' => 0,
|
'ret' => 0,
|
||||||
'msg' => 'user fetch fail'
|
'msg' => 'user fetch fail'
|
||||||
@ -93,6 +95,7 @@ class TrojanTidalabController extends Controller
|
|||||||
'trojan'
|
'trojan'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
return response([
|
return response([
|
||||||
'ret' => 1,
|
'ret' => 1,
|
||||||
|
@ -80,7 +80,7 @@ class UserService
|
|||||||
{
|
{
|
||||||
$user = User::find($userId);
|
$user = User::find($userId);
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
$user->t = time();
|
$user->t = time();
|
||||||
$user->u = $user->u + $u;
|
$user->u = $user->u + $u;
|
||||||
|
1
public/assets/admin/antd.async.js
vendored
1
public/assets/admin/antd.async.js
vendored
File diff suppressed because one or more lines are too long
1
public/assets/admin/components.async.js
vendored
Normal file
1
public/assets/admin/components.async.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/assets/user/umi.css
vendored
2
public/assets/user/umi.css
vendored
File diff suppressed because one or more lines are too long
2
public/assets/user/umi.js
vendored
2
public/assets/user/umi.js
vendored
File diff suppressed because one or more lines are too long
2
public/assets/user/vendors.async.js
vendored
2
public/assets/user/vendors.async.js
vendored
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="/assets/admin/antd.chunk.css?v={{$verison}}">
|
<link rel="stylesheet" href="/assets/admin/components.chunk.css?v={{$verison}}">
|
||||||
<link rel="stylesheet" href="/assets/admin/umi.css?v={{$verison}}">
|
<link rel="stylesheet" href="/assets/admin/umi.css?v={{$verison}}">
|
||||||
<link rel="stylesheet" href="/assets/admin/custom.css?v={{$verison}}">
|
<link rel="stylesheet" href="/assets/admin/custom.css?v={{$verison}}">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script src="/assets/admin/vendors.async.js?v={{$verison}}"></script>
|
<script src="/assets/admin/vendors.async.js?v={{$verison}}"></script>
|
||||||
<script src="/assets/admin/antd.async.js?v={{$verison}}"></script>
|
<script src="/assets/admin/components.async.js?v={{$verison}}"></script>
|
||||||
<script src="/assets/admin/umi.js?v={{$verison}}"></script>
|
<script src="/assets/admin/umi.js?v={{$verison}}"></script>
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-P1E9Z5LRRK"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-P1E9Z5LRRK"></script>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="/assets/user/antd.chunk.css?v={{$verison}}">
|
<link rel="stylesheet" href="/assets/user/components.chunk.css?v={{$verison}}">
|
||||||
<link rel="stylesheet" href="/assets/user/umi.css?v={{$verison}}">
|
<link rel="stylesheet" href="/assets/user/umi.css?v={{$verison}}">
|
||||||
<link rel="stylesheet" href="/assets/user/custom.css?v={{$verison}}">
|
<link rel="stylesheet" href="/assets/user/custom.css?v={{$verison}}">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script src="/assets/user/vendors.async.js?v={{$verison}}"></script>
|
<script src="/assets/user/vendors.async.js?v={{$verison}}"></script>
|
||||||
<script src="/assets/user/antd.async.js?v={{$verison}}"></script>
|
<script src="/assets/user/components.async.js?v={{$verison}}"></script>
|
||||||
<script src="/assets/user/umi.js?v={{$verison}}"></script>
|
<script src="/assets/user/umi.js?v={{$verison}}"></script>
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-P1E9Z5LRRK"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-P1E9Z5LRRK"></script>
|
||||||
|
Loading…
Reference in New Issue
Block a user