store-manage/app/Console/Commands/EmployeeSign.php

41 lines
852 B
PHP

<?php
namespace App\Console\Commands;
use App\Admin\Services\EmployeeSignService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class EmployeeSign extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:employee-sign';
/**
* The console command description.
*
* @var string
*/
protected $description = '员工签到情况统计';
/**
* Execute the console command.
*/
public function handle()
{
try {
DB::beginTransaction();
EmployeeSignService::make()->signResult();
DB::commit();
} catch (\Exception $e) {
DB::rollBack();
logger('app:employee-sign error');
logger()->error($e);
}
}
}