no message
This commit is contained in:
parent
e9615488d8
commit
2afa8cc4c2
@ -158,7 +158,7 @@ final class Cron
|
|||||||
$sixMonthsAgo = $now->copy()->subMonths(6);
|
$sixMonthsAgo = $now->copy()->subMonths(6);
|
||||||
$twelveMonthsAgo = $now->copy()->subMonths(12);
|
$twelveMonthsAgo = $now->copy()->subMonths(12);
|
||||||
|
|
||||||
$aCount = [
|
$aCountPay = [
|
||||||
'三月' => DB::table('user')
|
'三月' => DB::table('user')
|
||||||
->where('class', '>=', $iPayClass)
|
->where('class', '>=', $iPayClass)
|
||||||
->where('reg_date', '>', $threeMonthsAgo)
|
->where('reg_date', '>', $threeMonthsAgo)
|
||||||
@ -184,17 +184,40 @@ final class Cron
|
|||||||
->count(),
|
->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 = "# 付费用户计数 \n";
|
||||||
// $str .= "<table>";
|
|
||||||
foreach ($aCount as $k => $v) {
|
foreach ($aCountPay as $k => $v) {
|
||||||
$str .= "\n".$k.":".$v;
|
|
||||||
// $str .= "<tr>";
|
if ($v) {
|
||||||
// $str .= "<td>".$k."</td>";
|
$iRate = $v / $aCountAll[$k] * 100;
|
||||||
// $str .= "<td>".$v."</td>";
|
} else {
|
||||||
// $str .= "</tr>";
|
$iRate = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$str .= "\n".$k.":".$v." [共".$aCountAll[$k].",占".$iRate."%]";
|
||||||
}
|
}
|
||||||
// $str .= "</table>";
|
|
||||||
// $str .= "\n\n----END--------";
|
|
||||||
|
|
||||||
$oTelegramV2 = new TelegramV2("base");
|
$oTelegramV2 = new TelegramV2("base");
|
||||||
// $oTelegramV2->setMsgType("html");
|
// $oTelegramV2->setMsgType("html");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user