no message
This commit is contained in:
1 parent
e79bdc8123
commit
46f37caa42
3 files changed
+44
-1
No files matched your search
@@ -30,4 +30,44 @@ class GithubController extends Controller
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 始终返回数据,今天没有就是前一天,前一天没有就是异常情况
|
||||
public function getFnToday($sDate = false)
|
||||
{
|
||||
if (!$sDate) {
|
||||
$sDate = date("Ymd");
|
||||
}
|
||||
|
||||
$sCode = $sDate;
|
||||
|
||||
//// test
|
||||
// 20250721 - 23 有数据
|
||||
// $sCode = "20250720";
|
||||
|
||||
$bUpd = Article::where("code", $sCode)->exists();
|
||||
|
||||
if ($bUpd === true) {
|
||||
$sCodeTrue = $sCode;
|
||||
} else {
|
||||
$sCodeTrue = date("Ymd", strtotime("-1 day"));
|
||||
}
|
||||
|
||||
$sFilePathClash = "feed/clash-".$sCodeTrue.".yaml";
|
||||
$sFilePathV2ray = "feed/v2ray-".$sCodeTrue.".txt";
|
||||
|
||||
$sFileClash = file_get_contents($sFilePathClash);
|
||||
$sFileV2ray = file_get_contents($sFilePathV2ray);
|
||||
|
||||
$aData = [
|
||||
"code" => "100",
|
||||
"clash" => $sFileClash,
|
||||
"v2ray" => $sFileV2ray
|
||||
];
|
||||
|
||||
echo json_encode($aData);
|
||||
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user