From 1ef7196dad89042c7ca635660072e1d69fb816bc Mon Sep 17 00:00:00 2001 From: hellcat Date: Sun, 15 Mar 2026 12:23:33 +0800 Subject: [PATCH] no message --- app/Services/Tg/Hook/Mod/Cron.php | 64 ++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/app/Services/Tg/Hook/Mod/Cron.php b/app/Services/Tg/Hook/Mod/Cron.php index 2e547218..dad48def 100755 --- a/app/Services/Tg/Hook/Mod/Cron.php +++ b/app/Services/Tg/Hook/Mod/Cron.php @@ -31,38 +31,58 @@ class Cron extends Base { public function test($aParam) { - $sType = $aParam["aOption"][1] ?? "i"; - $sValue = $aParam["aArg"][1] ?? "03"; - if (!$sType) { - return "需要his之一"; - } + $h = $aParam["aArg"][1] ?? 0; + $i = $aParam["aArg"][2] ?? 3; + $s = $aParam["aArg"][3] ?? 0; - if (!$sValue) { - return "需要value"; - } - - if ($sValue == "?") { - return "#test__[his] [value]"; + if ($h == "?") { + return "#test [h:0] [i:3] [s:0]"; } $oServicesCron = new ServicesCron(); - $oServicesCron->setTestH('06'); - $oServicesCron->setTestI('03'); - $oServicesCron->setTestS('00'); - - if ($sType == "h") { - $oServicesCron->setTestH($sValue); - } else if ($sType == "i") { - $oServicesCron->setTestI($sValue); - } else if ($sType == "s") { - $oServicesCron->setTestS($sValue); - } + $oServicesCron->setTestH($h); + $oServicesCron->setTestI($i); + $oServicesCron->setTestS($s); return $oServicesCron->run(); } +// public function test($aParam) +// { +// $sType = $aParam["aOption"][1] ?? "i"; +// $sValue = $aParam["aArg"][1] ?? "03"; +// +// if (!$sType) { +// return "需要his之一"; +// } +// +// if (!$sValue) { +// return "需要value"; +// } +// +// if ($sValue == "?") { +// return "#test__[his] [value]"; +// } +// +// $oServicesCron = new ServicesCron(); +// +// $oServicesCron->setTestH('06'); +// $oServicesCron->setTestI('03'); +// $oServicesCron->setTestS('00'); +// +// if ($sType == "h") { +// $oServicesCron->setTestH($sValue); +// } else if ($sType == "i") { +// $oServicesCron->setTestI($sValue); +// } else if ($sType == "s") { +// $oServicesCron->setTestS($sValue); +// } +// +// return $oServicesCron->run(); +// } + public function testOld($aParam) { $sType = $aParam["aArg"][1] ?? false;