github/app/Services/TG/Hook/Mod/Test.php
2026-08-17 17:59:17 +08:00

105 lines
2.7 KiB
PHP

<?php
namespace App\Services\TG\Hook\Mod;
//use App\Services\TomTool\Http;
class Test extends Base {
public function cron($aParam)
{
if (($aParam["aArg"][1] ?? false) == "?") {
return "#cron__{type:id,i_in10,rand}__{bSendTg:y,n-default}__{bPull:y,n-defulat}";
}
$sTimeType = $aParam["aOption"][1];
$sValue = $aParam["aArg"][1];
// $sIsText = $aParam["aOption"][2] ?? "yes";
$sSendTg = $aParam["aOption"][2] ?? "n";
$sPull = $aParam["aOption"][3] ?? "n";
// if ($sSendTg == "yes") {
// $bSendTg = true;
// } else if ($sSendTg == "no") {
// $bSendTg = false;
// }
// if ($sIsText == "yes") {
// $is_test = true;
// } else if ($sIsText == "no") {
// $is_test = false;
// }
$this->oHttp->sMethod = "get";
$this->oHttp->sToUrl = env("APP_URL")."/cron";
$this->oHttp->bIsJson = true;
$this->oHttp->aData = [
"is_test" => true,
"time_type" => $sTimeType,
"v" => $sValue,
"sSendTg" => $sSendTg,
"sPull" => $sPull
];
$r = $this->oHttp->send();
return $r;
}
public function cronV2($aParam)
{
// echo 111;exit;
if (($aParam["aArg"][1] ?? false) == "?") {
return "#cron__{type:id,i_in10,rand}__{bSendTg:y,n-default}__{bPull:y,n-defulat}";
}
$sTimeType = $aParam["aOption"][1];
$sValue = $aParam["aArg"][1];
// $sIsText = $aParam["aOption"][2] ?? "yes";
$sSendTg = $aParam["aOption"][2] ?? "n";
$sPull = $aParam["aOption"][3] ?? "n";
// if ($sSendTg == "yes") {
// $bSendTg = true;
// } else if ($sSendTg == "no") {
// $bSendTg = false;
// }
// if ($sIsText == "yes") {
// $is_test = true;
// } else if ($sIsText == "no") {
// $is_test = false;
// }
// $shabi = "https://";
//
// if (env("www_master") == "dd.loc") {
// $shabi = "http://";
// }
$this->oHttp->sMethod = "get";
$this->oHttp->sToUrl = env("APP_URL")."/cronv2";
// var_dump($this->oHttp->sToUrl);exit;
$this->oHttp->bIsJson = true;
$this->oHttp->aData = [
"is_test" => true,
"time_type" => $sTimeType,
"v" => $sValue,
"sSendTg" => $sSendTg,
"sPull" => $sPull
];
$r = $this->oHttp->send();
return $r;
}
}