no message
This commit is contained in:
parent
e9615488d8
commit
2afa8cc4c2
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user