dd/app/Http/Controllers/SakaiFnController.php
2026-08-12 10:56:55 +08:00

60 lines
1.6 KiB
PHP
Executable File

<?php
namespace App\Http\Controllers;
//use Illuminate\Http\Request;
//use App\Models\ArticleList;
//use App\Services\Time;
//use voku\helper\AntiXSS;
//use App\Models\Tags;
//use App\Services\TomTool\Http;
//use App\Services\CountrySpeedService;
//use App\Services\ServiceFnPoolV2rayTo;
//use App\Models\FreenodePool as ModelFreenodePool;
//use App\Services\Cron\ReportTraffic;
use App\Models\FreenodePool;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
class SakaiFnController
{
public function looktrans(Request $oRequest, string $sClient = "singbox", string $sXieyi, ?string $sLike = '')
{
$sDate = date("Y-m-d");
$sContent = FreenodePool::whereDate("date", $sDate)->first()?->content;
$aContent = json_decode($sContent, true);
$cClientContent = $aContent[$sClient];
$aNode = [];
if ($sClient == "singbox") {
foreach ($cClientContent as $sMd5 => $aClientContent) {
$sContentXieyi = $aClientContent["protocolType"] ?? '';
if ($sXieyi != "all" && $sContentXieyi != $sXieyi) {
continue;
}
$sNodeName = $aClientContent["country"];
if ($sLike) {
if (!Str::contains($sNodeName, $sLike, true)) {
continue;
}
}
$aNode[] = $aClientContent;
}
}
tt($aNode);
// tt($aContent[$sClient]);
}
}