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->visitorCount();
// $jobs->visitorCount();
// 每日统计报表 - 用户
$jobs->userCount();

View File

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

View File

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