no message

This commit is contained in:
hellcat 2025-03-31 21:38:24 +08:00
parent a92d2f94b1
commit bcd9a2d2a9
3 changed files with 35 additions and 35 deletions

View File

@ -65,7 +65,7 @@ EOL;
$jobs->clearTgStep(); $jobs->clearTgStep();
// 每日统计报表 - 访客 // 每日统计报表 - 访客
$jobs->visitorCount(); // $jobs->visitorCount();
// 每日统计报表 - 用户 // 每日统计报表 - 用户
$jobs->userCount(); $jobs->userCount();

View File

@ -176,37 +176,37 @@ final class Cron
Visitor::truncate(); Visitor::truncate();
} }
public static function visitorCount(): void // public static function visitorCount(): void
{ // {
$oVisitor = Visitor::select('from', DB::raw('count(*) as count')) // $oVisitor = Visitor::select('from', DB::raw('count(*) as count'))
->groupBy('from') // ->groupBy('from')
->get(); // ->get();
//
foreach ($oVisitor as $row) { // foreach ($oVisitor as $row) {
//
$oCountVisitor = new CountVisitor(); // $oCountVisitor = new CountVisitor();
$oCountVisitor->from = $row->from; // $oCountVisitor->from = $row->from;
$oCountVisitor->count = $row->count; // $oCountVisitor->count = $row->count;
$oCountVisitor->date = date('Y-m-d', strtotime('-1 day')); // $oCountVisitor->date = date('Y-m-d', strtotime('-1 day'));
$oCountVisitor->save(); // $oCountVisitor->save();
//
} // }
//
Visitor::truncate(); // Visitor::truncate();
//
// tg报表 // // tg报表
$aCountVisitor = CountVisitor::where('date', date('Y-m-d', strtotime('-1 day')))->get()->toArray(); // $aCountVisitor = CountVisitor::where('date', date('Y-m-d', strtotime('-1 day')))->get()->toArray();
//
$sTgReport = ''; // $sTgReport = '';
foreach ($aCountVisitor as $row) { // foreach ($aCountVisitor as $row) {
//
$sTgReport .= $row["from"]."".$row["count"]."\n"; // $sTgReport .= $row["from"]."".$row["count"]."\n";
//
} // }
//
(new Telegram())->send(0, $sTgReport); // (new Telegram())->send(0, $sTgReport);
//
} // }
public static function detectInactiveUser(): void public static function detectInactiveUser(): void
{ {

View File

@ -69,7 +69,7 @@ final class ReportUser
$iTotalMoneyCount += $row['count_money'] ?? 0; $iTotalMoneyCount += $row['count_money'] ?? 0;
} }
$sStr = ""; $sStr = "🎹🎹🎹🎹🎹🎹\n";
$sStr .= "*总访问:".$iTotalFromCount."\n"; $sStr .= "*总访问:".$iTotalFromCount."\n";
$sStr .= "*总注册:".$iTotalRegCount."\n"; $sStr .= "*总注册:".$iTotalRegCount."\n";
$sStr .= "*总支付:".$iTotalPayCount."\n"; $sStr .= "*总支付:".$iTotalPayCount."\n";
@ -97,8 +97,8 @@ final class ReportUser
$iMoneyRate = (int)(($row['count_money'] / $iTotalMoneyCount) * 100); $iMoneyRate = (int)(($row['count_money'] / $iTotalMoneyCount) * 100);
} }
$sStr .= "\n\n"; $sStr .= "\n";
$sStr .= $row['from'].'\n'; $sStr .= '['.$row['from'].']\n';
$sStr .= " - 访问:".$row['count_from']."(".$iFromRate."%)\n"; $sStr .= " - 访问:".$row['count_from']."(".$iFromRate."%)\n";
$sStr .= " - 注册:".$row['count_reg']."(".$iRegRate."%)\n"; $sStr .= " - 注册:".$row['count_reg']."(".$iRegRate."%)\n";
$sStr .= " - 支付:".$row['count_pay']."(".$iPayRate."%)【新".$row['count_pay_new']."".$row['count_pay_old']."\n"; $sStr .= " - 支付:".$row['count_pay']."(".$iPayRate."%)【新".$row['count_pay_new']."".$row['count_pay_old']."\n";