From 069e39499061818777ab5d46ba214c1c1b673155 Mon Sep 17 00:00:00 2001 From: hellcat <> Date: Tue, 25 Nov 2025 20:28:31 +0800 Subject: [PATCH] no message --- app/Services/Cron.php | 7 ++++-- app/Services/Cron/Book.php | 41 +++++++++++++++++++++++++++++++ app/Services/Tg/Hook/Mod/Cron.php | 2 +- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 app/Services/Cron/Book.php diff --git a/app/Services/Cron.php b/app/Services/Cron.php index 427ba413..dd5dbe00 100644 --- a/app/Services/Cron.php +++ b/app/Services/Cron.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace App\Services; use App\Services\Cron\HttpQueue as CronHttpQueue; +use App\Services\Cron\Book as CronBook; use App\Services\Cron\ArticleSchema as CronArticleSchema; use App\Services\TomTool\Telegram\Slave as TeleSlave; @@ -28,10 +29,12 @@ final class Cron } echo "cron开始执行\n\n"; -// TeleSlave::log()->enableSlaveQueue(false)->send("master_cron_run:".date("Y-m-d H:i:s")); + + if ($h % 6 === 0) { + CronBook::randbox_notify(); + } if ($i % 3 === 0) { -// TeleSlave::log()->enableSlaveQueue(false)->send("master_cron_run__hit!!:".date("Y-m-d H:i:s")); CronArticleSchema::cacheTgSave(); CronArticleSchema::pushToSlave(); CronHttpQueue::pop(); diff --git a/app/Services/Cron/Book.php b/app/Services/Cron/Book.php new file mode 100644 index 00000000..3e162ae2 --- /dev/null +++ b/app/Services/Cron/Book.php @@ -0,0 +1,41 @@ +first(); + + $sRandBoxPath = $oBook->path.$oBook->id."/"; + + $aBookRandbox = ModelBook::where("path", $sRandBoxPath)->where("is_del", 0)->get()->toArray(); + + $sRandBoxPathLen = count($aBookRandbox) - 1; + + $iRandKey = rand(0, $sRandBoxPathLen); + + $aGetOne = $aBookRandbox[$iRandKey]; + + $sMsg = $aGetOne["rag"]; + + TelegramSlave::notify()->send($sMsg); + + tomd($sMsg); + } + +} diff --git a/app/Services/Tg/Hook/Mod/Cron.php b/app/Services/Tg/Hook/Mod/Cron.php index 1e16976e..89d2adb2 100644 --- a/app/Services/Tg/Hook/Mod/Cron.php +++ b/app/Services/Tg/Hook/Mod/Cron.php @@ -33,7 +33,7 @@ class Cron extends Base { $oServicesCron = new ServicesCron(); - $oServicesCron->setTestH('00'); + $oServicesCron->setTestH('06'); $oServicesCron->setTestI('00'); $oServicesCron->setTestS('00');