mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-15 04:10:51 +08:00
- Add system log cleanup functionality with batch processing - Optimize v2_settings table performance by unifying value storage - Add comprehensive client support list for one-click subscription - Fix QR code subscription links for specific node types - Fix route addition issues in admin management panel - Enhance admin system controller with log management APIs
49 lines
999 B
PHP
49 lines
999 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\Log;
|
|
use App\Models\StatServer;
|
|
use App\Models\StatUser;
|
|
use Illuminate\Console\Command;
|
|
|
|
class ResetLog extends Command
|
|
{
|
|
protected $builder;
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'reset:log';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = '清空日志';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle()
|
|
{
|
|
StatUser::where('record_at', '<', strtotime('-2 month', time()))->delete();
|
|
StatServer::where('record_at', '<', strtotime('-2 month', time()))->delete();
|
|
Log::where('created_at', '<', strtotime('-1 month', time()))->delete();
|
|
}
|
|
}
|