43 lines
917 B
PHP
43 lines
917 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ReportDuty extends Model
|
|
{
|
|
protected $fillable = [
|
|
'report_date',
|
|
'sent_at',
|
|
'period_type',
|
|
'period_start',
|
|
'period_end',
|
|
'status_id',
|
|
'rf_lpudoctor_id',
|
|
'rf_department_id',
|
|
'rf_user_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'report_date' => 'date:Y-m-d',
|
|
'sent_at' => 'datetime:Y-m-d H:i:s',
|
|
'period_start' => 'datetime:Y-m-d H:i:s',
|
|
'period_end' => 'datetime:Y-m-d H:i:s',
|
|
];
|
|
|
|
public function department()
|
|
{
|
|
return $this->belongsTo(Department::class, 'rf_department_id', 'department_id');
|
|
}
|
|
|
|
public function patients()
|
|
{
|
|
return $this->hasMany(ReportNursePatient::class, 'report_nurse_id');
|
|
}
|
|
|
|
public function status()
|
|
{
|
|
return $this->belongsTo(ReportStatus::class);
|
|
}
|
|
}
|