Files
nexusphp/app/Console/Commands/AttendanceCleanup.php

50 lines
998 B
PHP
Raw Normal View History

2021-06-10 21:07:20 +08:00
<?php
namespace App\Console\Commands;
use App\Models\Attendance;
2022-04-03 16:03:47 +08:00
use App\Repositories\AttendanceRepository;
2021-06-10 21:07:20 +08:00
use Illuminate\Console\Command;
class AttendanceCleanup extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'attendance:cleanup';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Cleanup attendance data.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
2022-04-03 16:03:47 +08:00
$rep = new AttendanceRepository();
$result = $rep->cleanup();
$log = sprintf(
'[%s], %s, result: %s',
nexus()->getRequestId(), __METHOD__, var_export($result, true)
);
$this->info($log);
do_log($log);
2021-06-10 21:07:20 +08:00
}
}