* изменил таблицы в основном отчете
* изменил метод сохранения пациентов основного отчета
This commit is contained in:
42
app/Models/ReportDuty.php
Normal file
42
app/Models/ReportDuty.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user