From 38764c17ced9547e260f2b7ba6784fe88dd0bb06 Mon Sep 17 00:00:00 2001 From: hellcat Date: Wed, 6 May 2026 13:59:52 +0800 Subject: [PATCH] no message --- src/Command/Cron.php | 3 +++ src/Services/Cron.php | 19 +++++++++++++++++++ src/Services/Tg/Hook/Mod/MailMust.php | 26 ++++++++++++++++++++++++++ src/Services/Tg/Hook/Mod/Test.php | 21 +++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 src/Services/Tg/Hook/Mod/MailMust.php diff --git a/src/Command/Cron.php b/src/Command/Cron.php index 68e02af91..7adef8d3e 100755 --- a/src/Command/Cron.php +++ b/src/Command/Cron.php @@ -84,9 +84,12 @@ EOL; $jobs->smtpClearDayCount(); // 重置stmp的day_count + //// *start 邮件报表 + $jobs->mailLogReport(); $jobs->vcodeReport(); // 每日验证码注册率报表 $jobs->mailMustReport(); // 每日mailMust报表 - 需在重置之前 $jobs->mailMust_reset_month(); // 每天8点,check重置mailMust的month_count + //// *end 邮件报表 // 每日清除前一天残留TgStep $jobs->clearTgStep(); diff --git a/src/Services/Cron.php b/src/Services/Cron.php index 7b0c7fb88..34fee0bbc 100755 --- a/src/Services/Cron.php +++ b/src/Services/Cron.php @@ -60,6 +60,25 @@ use App\Services\TomTool\Telegram\Slave as TeleSlave; final class Cron { + // maillog报表(监控title) + public static function mailLogReport() + { + $cMailLogCount = ModelMailLog::select('title', DB::raw('count(*) as total')) + ->groupBy('title') + ->orderBy('total', 'desc') + ->get(); + + $sMsg = "\n====== ".$_ENV["site_code"]."发送邮件标题统计 ======"; + foreach ($cMailLogCount as $oMailLogCount) { + $sMsg .= "\n".$oMailLogCount->title.":".$oMailLogCount->total; + } + + TeleSlave::notify()->enableDetail(false)->send($sMsg); + + echo "\nmailLogReport - ok"; + + } + // 必达邮件报表 - 必须在重置之前调用 public static function mailMustReport() { diff --git a/src/Services/Tg/Hook/Mod/MailMust.php b/src/Services/Tg/Hook/Mod/MailMust.php new file mode 100644 index 000000000..80e44928c --- /dev/null +++ b/src/Services/Tg/Hook/Mod/MailMust.php @@ -0,0 +1,26 @@ +oDog = new Dog(new ModelMailMust()); + $this->oDog->_setDogName("mailMust"); // 必须,me用,正常就是类名,只不过后期没准改名,所以就这里写死 +// $this->oDog->_setPrimaryKey("code"); // 可选,默认id +// $this->oDog->_setStrField(["content"]); // 可选,指定长文本字段 + } + + public function __call($sName, $aArg) + { + return $this->oDog->$sName($aArg[0]); + } + +} diff --git a/src/Services/Tg/Hook/Mod/Test.php b/src/Services/Tg/Hook/Mod/Test.php index 680820437..f4c08968f 100644 --- a/src/Services/Tg/Hook/Mod/Test.php +++ b/src/Services/Tg/Hook/Mod/Test.php @@ -49,6 +49,27 @@ final class Test extends Base return $this->cron($aParam); } + public function t2() + { + $path = "assets/baba/default_files/img_barbar/_hua.svg"; + + if (!file_exists($path)) return 'null'; + + $svgContent = file_get_contents($path); + // 关键:先转成 base64 字符串 + $base64 = base64_encode($svgContent); + + $sizeInBytes = strlen($base64); + + // 转换为 KB + $sizeInKB = $sizeInBytes / 1024; + + echo "Base64 字符串大小: " . round($sizeInKB, 2) . " KB"; + + // 拼接 Data URI 头部 +// return 'data:image/svg+xml;base64,' . $base64; + } + public function t1() {