no message

This commit is contained in:
hellcat 2025-10-18 18:34:56 +08:00
parent e9615488d8
commit 2afa8cc4c2

View File

@ -158,7 +158,7 @@ final class Cron
$sixMonthsAgo = $now->copy()->subMonths(6);
$twelveMonthsAgo = $now->copy()->subMonths(12);
$aCount = [
$aCountPay = [
'三月' => DB::table('user')
->where('class', '>=', $iPayClass)
->where('reg_date', '>', $threeMonthsAgo)
@ -184,17 +184,40 @@ final class Cron
->count(),
];
$aCountAll = [
'三月' => DB::table('user')
->where('reg_date', '>', $threeMonthsAgo)
->count(),
'半年' => DB::table('user')
->whereBetween('reg_date', [$sixMonthsAgo, $threeMonthsAgo])
->count(),
'一年' => DB::table('user')
->whereBetween('reg_date', [$twelveMonthsAgo, $sixMonthsAgo])
->count(),
'一年+' => DB::table('user')
->where('reg_date', '<=', $twelveMonthsAgo)
->count(),
'总共' => DB::table('user')
->where('class', '<', $iPayClass)
->count(),
];
$str = "# 付费用户计数 \n";
// $str .= "<table>";
foreach ($aCount as $k => $v) {
$str .= "\n".$k."".$v;
// $str .= "<tr>";
// $str .= "<td>".$k."</td>";
// $str .= "<td>".$v."</td>";
// $str .= "</tr>";
foreach ($aCountPay as $k => $v) {
if ($v) {
$iRate = $v / $aCountAll[$k] * 100;
} else {
$iRate = 0;
}
$str .= "\n".$k."".$v." [共".$aCountAll[$k].",占".$iRate."%]";
}
// $str .= "</table>";
// $str .= "\n\n----END--------";
$oTelegramV2 = new TelegramV2("base");
// $oTelegramV2->setMsgType("html");