github/app/Services/TG/Hook/Mod/Test.php
2025-07-15 19:28:20 +08:00

48 lines
1.1 KiB
PHP

<?php
namespace App\Services\TG\Hook\Mod;
//use App\Services\TomTool\Http;
class Test extends Base {
public function Cron($aParam)
{
$sTimeType = $aParam["aOption"][1];
$sValue = $aParam["aArg"][1];
// $sIsText = $aParam["aOption"][2] ?? "yes";
$sSendTg = $aParam["aOption"][2] ?? "n";
if ($sValue == "?") {
return "#cron__{type:id,i_in10,rand}__{bSendTg:y,n-default}";
}
// 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,
"bSendTg" => $sSendTg
];
$r = $this->oHttp->send();
return $r;
}
}