generated from liutk/owl-admin-base
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
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 $fillable = ['store_id', 'employee_id', 'sign_type', 'sign_time', 'remarks', 'position', 'time', 'is_repair', 'outside_remarks', 'repair_id'];
|
|
|
|
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');
|
|
}
|
|
}
|