diff --git a/app/Http/Controllers/CronController.php b/app/Http/Controllers/CronController.php index a835b3a..94368d9 100755 --- a/app/Http/Controllers/CronController.php +++ b/app/Http/Controllers/CronController.php @@ -34,6 +34,7 @@ class CronController $s = date("s"); $iRand = rand(1, 1440); $aUpdate = []; + $bSendTg = true; // $isTest = 0; //test @@ -53,6 +54,10 @@ class CronController } } + if (isset($aGet["bSendTg"])) { + $bSendTg = $aGet["bSendTg"]; + } + // 暂停 $option = Option::where("type", "pause")->first(); $isPause = $option ? $option->value : null; diff --git a/app/Services/TG/Hook/Mod/Test.php b/app/Services/TG/Hook/Mod/Test.php index 60b1237..e1b51a2 100644 --- a/app/Services/TG/Hook/Mod/Test.php +++ b/app/Services/TG/Hook/Mod/Test.php @@ -9,21 +9,33 @@ class Test extends Base { { $sTimeType = $aParam["aOption"][1]; $sValue = $aParam["aArg"][1]; - $sIsText = $aParam["aOption"][2] ?? "yes"; - - if ($sIsText == "yes") { - $is_test = true; - } else if ($sIsText == "no") { - $is_test = false; +// $sIsText = $aParam["aOption"][2] ?? "yes"; + $sSendTg = $aParam["aOption"][2] ?? "no"; + + if ($sValue == "?") { + return "#cron__{type:id,i_in10,rand}__{bSendTg:yes,no-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" => $is_test, + "is_test" => true, "time_type" => $sTimeType, - "v" => $sValue + "v" => $sValue, + "bSendTg" => $bSendTg ]; $r = $this->oHttp->send();