diff --git a/src/Command/Cron.php b/src/Command/Cron.php index 5ea47a8b..e5646517 100755 --- a/src/Command/Cron.php +++ b/src/Command/Cron.php @@ -65,7 +65,7 @@ EOL; $jobs->clearTgStep(); // 每日统计报表 - 访客 - $jobs->visitorCount(); +// $jobs->visitorCount(); // 每日统计报表 - 用户 $jobs->userCount(); diff --git a/src/Services/Cron.php b/src/Services/Cron.php index 8c92f8c5..cf122b0e 100755 --- a/src/Services/Cron.php +++ b/src/Services/Cron.php @@ -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 { diff --git a/src/Services/Tg/ReportUser.php b/src/Services/Tg/ReportUser.php index e1dbfd97..05919429 100755 --- a/src/Services/Tg/ReportUser.php +++ b/src/Services/Tg/ReportUser.php @@ -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";