generated from liutk/owl-admin-base
45 lines
936 B
PHP
45 lines
936 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\SignTime;
|
|
use App\Enums\SignType;
|
|
use App\Traits\HasDateTimeFormatter;
|
|
use EloquentFilter\Filterable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* 员工-打卡流水
|
|
*/
|
|
class EmployeeSignLog extends Model
|
|
{
|
|
use Filterable, HasDateTimeFormatter, HasFactory;
|
|
|
|
protected $table = 'employee_sign_logs';
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $casts = [
|
|
'sign_type' => SignType::class,
|
|
'sign_time' => SignTime::class,
|
|
'position' => 'json',
|
|
'time' => 'datetime',
|
|
];
|
|
|
|
public function modelFilter()
|
|
{
|
|
return \App\Admin\Filters\EmployeeSignLogFilter::class;
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
return $this->belongsTo(Store::class, 'store_id');
|
|
}
|
|
|
|
public function employee()
|
|
{
|
|
return $this->belongsTo(Employee::class, 'employee_id');
|
|
}
|
|
}
|