no message
This commit is contained in:
parent
b2ccba1df3
commit
a74ef3f56f
@ -68,6 +68,7 @@ EOL;
|
||||
) {
|
||||
$jobs->cleanDb();
|
||||
// $jobs->resetNodeBandwidth();
|
||||
$jobs->reportPayUser(); // 付费用户统计
|
||||
$jobs->resetDuckBandwidth(); // 重置每日的duck流量
|
||||
$jobs->reportBandWidth(); // 报告流量给tg
|
||||
$jobs->resetFreeUserBandwidth(); // 重置免费用户的流量
|
||||
|
||||
@ -47,7 +47,7 @@ final class ProductController extends BaseController
|
||||
} else if ($aProductRow["class_time"] < 180) {
|
||||
$aProductRow["time_group_str"] = "季付";
|
||||
} else if ($aProductRow["class_time"] < 360) {
|
||||
$aProductRow["time_group_str"] = "半年";
|
||||
$aProductRow["time_group_str"] = "半年付";
|
||||
} else {
|
||||
$aProductRow["time_group_str"] = "年付";
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ use function time;
|
||||
use const PHP_EOL;
|
||||
use App\Models\Smtp as ModelSmtp;
|
||||
//use Illuminate\Support\Facades\DB; // 线上可能要开
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
||||
final class Cron
|
||||
@ -146,6 +147,54 @@ final class Cron
|
||||
TgStep::where("date", "<=", date('Y-m-d', strtotime('-1 day')))->delete();
|
||||
}
|
||||
|
||||
// 付费用户统计
|
||||
public static function reportPayUser(): void
|
||||
{
|
||||
$iPayClass = $_ENV["user_payClass"];
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$threeMonthsAgo = $now->copy()->subMonths(3);
|
||||
$sixMonthsAgo = $now->copy()->subMonths(6);
|
||||
$twelveMonthsAgo = $now->copy()->subMonths(12);
|
||||
|
||||
$aCount = [
|
||||
'三月' => DB::table('user')
|
||||
->where('class', '>=', $iPayClass)
|
||||
->where('reg_date', '>', $threeMonthsAgo)
|
||||
->count(),
|
||||
|
||||
'半年' => DB::table('user')
|
||||
->where('class', '>=', $iPayClass)
|
||||
->whereBetween('reg_date', [$sixMonthsAgo, $threeMonthsAgo])
|
||||
->count(),
|
||||
|
||||
'一年' => DB::table('user')
|
||||
->where('class', '>=', $iPayClass)
|
||||
->whereBetween('reg_date', [$twelveMonthsAgo, $sixMonthsAgo])
|
||||
->count(),
|
||||
|
||||
'一年+' => DB::table('user')
|
||||
->where('class', '>=', $iPayClass)
|
||||
->where('reg_date', '<=', $twelveMonthsAgo)
|
||||
->count(),
|
||||
|
||||
'总共' => DB::table('user')
|
||||
->where('class', '>=', $iPayClass)
|
||||
->count(),
|
||||
];
|
||||
|
||||
$str = "# 付费用户计数";
|
||||
foreach ($aCount as $k => $v) {
|
||||
$str .= "\n".$k.":".$v;
|
||||
}
|
||||
|
||||
$oTelegramV2 = new TelegramV2("base");
|
||||
$oTelegramV2->setMsgType("html");
|
||||
$oTelegramV2->send($str, "str");
|
||||
|
||||
}
|
||||
|
||||
// 统计用户数据,入库,发送tg
|
||||
public static function userCount(): void
|
||||
{
|
||||
|
||||
@ -180,6 +180,12 @@ final class Test extends Base
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function reportPayUser()
|
||||
{
|
||||
$oJob = new Cron();
|
||||
$oJob->reportPayUser();
|
||||
}
|
||||
|
||||
public function orderPay()
|
||||
{
|
||||
$job = new Cron();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user