generated from liutk/owl-admin-base
43 lines
921 B
PHP
43 lines
921 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Enums\{SignTime};
|
|
use App\Traits\HasDateTimeFormatter;
|
|
use EloquentFilter\Filterable;
|
|
use App\Traits\HasCheckable;
|
|
|
|
/**
|
|
* 补卡申请
|
|
*/
|
|
class EmployeeSignRepair extends Model
|
|
{
|
|
use HasDateTimeFormatter, Filterable, HasCheckable;
|
|
|
|
protected $table = 'employee_sign_repairs';
|
|
|
|
protected $fillable = ['date', 'store_id', 'employee_id', 'reason', 'repair_type'];
|
|
|
|
protected $casts = [
|
|
'date' => 'date:Y-m-d',
|
|
'checked_at' => 'datetime',
|
|
'repair_type' => SignTime::class,
|
|
];
|
|
|
|
public function modelFilter()
|
|
{
|
|
return \App\Admin\Filters\EmployeeSignRepairFilter::class;
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
return $this->belongsTo(Store::class, 'store_id');
|
|
}
|
|
|
|
public function employee()
|
|
{
|
|
return $this->belongsTo(Employee::class, 'employee_id');
|
|
}
|
|
}
|