mirror of
https://github.com/v2board/v2board.git
synced 2025-01-27 00:19:10 +08:00
update
This commit is contained in:
parent
f03dbd1dcb
commit
508961c4fb
@ -43,28 +43,5 @@ class V2boardCache extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->setMonthIncome();
|
|
||||||
$this->setMonthRegisterTotal();
|
|
||||||
}
|
|
||||||
|
|
||||||
private function setMonthIncome()
|
|
||||||
{
|
|
||||||
Cache::put(
|
|
||||||
'month_income',
|
|
||||||
Order::where('created_at', '>=', strtotime(date('Y-m-1')))
|
|
||||||
->where('created_at', '<', time())
|
|
||||||
->where('status', '3')
|
|
||||||
->sum('total_amount')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function setMonthRegisterTotal()
|
|
||||||
{
|
|
||||||
Cache::put(
|
|
||||||
'month_register_total',
|
|
||||||
User::where('created_at', '>=', strtotime(date('Y-m-1')))
|
|
||||||
->where('created_at', '<', time())
|
|
||||||
->count()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class MailController extends Controller
|
|||||||
'url' => config('v2board.app_url'),
|
'url' => config('v2board.app_url'),
|
||||||
'content' => $request->input('content')
|
'content' => $request->input('content')
|
||||||
]
|
]
|
||||||
]);
|
])->onQueue('other_mail');
|
||||||
}
|
}
|
||||||
|
|
||||||
return response([
|
return response([
|
||||||
|
@ -18,15 +18,19 @@ class StatController extends Controller
|
|||||||
{
|
{
|
||||||
return response([
|
return response([
|
||||||
'data' => [
|
'data' => [
|
||||||
'month_income' => Cache::get('month_income'),
|
'month_income' => Order::where('created_at', '>=', strtotime(date('Y-m-1')))
|
||||||
'month_register_total' => Cache::get('month_register_total'),
|
->where('created_at', '<', time())
|
||||||
|
->where('status', '3')
|
||||||
|
->sum('total_amount'),
|
||||||
|
'month_register_total' => User::where('created_at', '>=', strtotime(date('Y-m-1')))
|
||||||
|
->where('created_at', '<', time())
|
||||||
|
->count(),
|
||||||
'ticket_pendding_total' => Ticket::where('status', 0)
|
'ticket_pendding_total' => Ticket::where('status', 0)
|
||||||
->count(),
|
->count(),
|
||||||
'commission_pendding_total' => Order::where('commission_status', 0)
|
'commission_pendding_total' => Order::where('commission_status', 0)
|
||||||
->where('invite_user_id', '!=', NULL)
|
->where('invite_user_id', '!=', NULL)
|
||||||
->where('status', 3)
|
->where('status', 3)
|
||||||
->count(),
|
->count(),
|
||||||
|
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use App\Utils\Helper;
|
|||||||
|
|
||||||
class AppController extends Controller
|
class AppController extends Controller
|
||||||
{
|
{
|
||||||
CONST CLIENT_CONFIG = '{"policy":{"levels":{"0":{"uplinkOnly":0}}},"dns":{"servers":["114.114.114.114","8.8.8.8"]},"outboundDetour":[{"protocol":"freedom","tag":"direct","settings":{}}],"inbound":{"listen":"0.0.0.0","port":31211,"protocol":"socks","settings":{"auth":"noauth","udp":true,"ip":"127.0.0.1"}},"inboundDetour":[{"listen":"0.0.0.0","allocate":{"strategy":"always","refresh":5,"concurrency":3},"port":31210,"protocol":"http","tag":"httpDetour","domainOverride":["http","tls"],"streamSettings":{},"settings":{"timeout":0}}],"routing":{"strategy":"rules","settings":{"domainStrategy":"IPIfNonMatch","rules":[{"type":"field","ip":["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.2.0/24","192.168.0.0/16","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","::1/128","fc00::/7","fe80::/10"],"outboundTag":"direct"},{"type":"field","ip":["geoip:cn"],"outboundTag":"direct"}]}},"outbound":{"tag":"proxy","sendThrough":"0.0.0.0","mux":{"enabled":false,"concurrency":8},"protocol":"vmess","settings":{"vnext":[{"address":"server","port":443,"users":[{"id":"uuid","alterId":2,"security":"auto","level":0}],"remark":"remark"}]},"streamSettings":{"network":"tcp","tcpSettings":{"header":{"type":"none"}},"security":"none","tlsSettings":{"allowInsecure":true,"allowInsecureCiphers":true},"kcpSettings":{"header":{"type":"none"},"mtu":1350,"congestion":false,"tti":20,"uplinkCapacity":5,"writeBufferSize":1,"readBufferSize":1,"downlinkCapacity":20},"wsSettings":{"path":"","headers":{"Host":"server.cc"}}}}}';
|
CONST CLIENT_CONFIG = '{"policy":{"levels":{"0":{"uplinkOnly":0}}},"dns":{"servers":["114.114.114.114","8.8.8.8"]},"outboundDetour":[{"protocol":"freedom","tag":"direct","settings":{}}],"inbound":{"listen":"0.0.0.0","port":31211,"protocol":"socks","settings":{"auth":"noauth","udp":true,"ip":"127.0.0.1"}},"inboundDetour":[{"listen":"0.0.0.0","allocate":{"strategy":"always","refresh":5,"concurrency":3},"port":31210,"protocol":"http","tag":"httpDetour","domainOverride":["http","tls"],"streamSettings":{},"settings":{"timeout":0}}],"routing":{"strategy":"rules","settings":{"domainStrategy":"IPIfNonMatch","rules":[{"type":"field","ip":["geoip:cn"],"outboundTag":"direct"},{"type":"field","ip":["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.2.0/24","192.168.0.0/16","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","::1/128","fc00::/7","fe80::/10"],"outboundTag":"direct"}]}},"outbound":{"tag":"proxy","sendThrough":"0.0.0.0","mux":{"enabled":false,"concurrency":8},"protocol":"vmess","settings":{"vnext":[{"address":"server","port":443,"users":[{"id":"uuid","alterId":2,"security":"auto","level":0}],"remark":"remark"}]},"streamSettings":{"network":"tcp","tcpSettings":{"header":{"type":"none"}},"security":"none","tlsSettings":{"allowInsecure":true,"allowInsecureCiphers":true},"kcpSettings":{"header":{"type":"none"},"mtu":1350,"congestion":false,"tti":20,"uplinkCapacity":5,"writeBufferSize":1,"readBufferSize":1,"downlinkCapacity":20},"wsSettings":{"path":"","headers":{"Host":"server.cc"}}}}}';
|
||||||
CONST SOCKS_PORT = 10010;
|
CONST SOCKS_PORT = 10010;
|
||||||
CONST HTTP_PORT = 10011;
|
CONST HTTP_PORT = 10011;
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ class AppController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($request->input('is_global')) {
|
if ($request->input('is_global')) {
|
||||||
$json->routing->settings->rules[5]->outboundTag = 'proxy';
|
$json->routing->settings->rules[0]->outboundTag = 'proxy';
|
||||||
}
|
}
|
||||||
if ($server->tls) {
|
if ($server->tls) {
|
||||||
$json->outbound->streamSettings->security = "tls";
|
$json->outbound->streamSettings->security = "tls";
|
||||||
|
@ -9,6 +9,7 @@ use Illuminate\Http\Exceptions\HttpResponseException;
|
|||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use App\Utils\Helper;
|
use App\Utils\Helper;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use App\Jobs\SendEmail;
|
||||||
|
|
||||||
class CommController extends Controller
|
class CommController extends Controller
|
||||||
{
|
{
|
||||||
@ -38,21 +39,17 @@ class CommController extends Controller
|
|||||||
}
|
}
|
||||||
$code = Helper::randomChar(6);
|
$code = Helper::randomChar(6);
|
||||||
$subject = config('v2board.app_name', 'V2Board') . '邮箱验证码';
|
$subject = config('v2board.app_name', 'V2Board') . '邮箱验证码';
|
||||||
Mail::send(
|
|
||||||
'mail.sendEmailVerify',
|
SendEmail::dispatch([
|
||||||
[
|
'email' => $user->email,
|
||||||
'code' => $code,
|
'subject' => $subject,
|
||||||
|
'template_name' => 'mail.sendEmailVerify',
|
||||||
|
'template_value' => [
|
||||||
'name' => config('v2board.app_name', 'V2Board'),
|
'name' => config('v2board.app_name', 'V2Board'),
|
||||||
|
'code' => $code,
|
||||||
'url' => config('v2board.app_url')
|
'url' => config('v2board.app_url')
|
||||||
],
|
]
|
||||||
function ($message) use ($email, $subject) {
|
])->onQueue('verify_mail');
|
||||||
$message->to($email)->subject($subject);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (count(Mail::failures()) >= 1) {
|
|
||||||
// 发送失败
|
|
||||||
abort(500, '发送失败');
|
|
||||||
}
|
|
||||||
|
|
||||||
Cache::put($cacheKey, $code, 60);
|
Cache::put($cacheKey, $code, 60);
|
||||||
return response([
|
return response([
|
||||||
|
Loading…
Reference in New Issue
Block a user