coinwind/app/Console/Commands/CoinClean.php

47 lines
849 B
PHP

<?php
namespace App\Console\Commands;
use App\AdminOperationLog;
use App\Base;
use Illuminate\Console\Command;
class CoinClean extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'coin:clean';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Remove outdated logs, records, etc.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
$oldest = Base::days_ago_s(time(), 1);
AdminOperationLog::where('updated_at', '<', $oldest)->delete();
}
}