Роли, переделывание отчета, изменение на главной странице

This commit is contained in:
brusnitsyn
2026-01-11 23:37:18 +09:00
parent eb019504d7
commit d4f077cdaf
59 changed files with 2099 additions and 366 deletions

View File

@@ -6,17 +6,29 @@ use Illuminate\Database\Eloquent\Model;
class Department extends Model
{
protected $table = 'oms_department';
protected $primaryKey = 'departmentid';
public $timestamps = false;
protected $primaryKey = 'department_id';
protected $fillable = [
'departmentname',
'rf_lpuid'
'name_full',
'name_short',
'rf_mis_department_id',
'rf_department_type'
];
public function lpu(): \Illuminate\Database\Eloquent\Relations\HasOne
public function metrikaDefault()
{
return $this->hasOne(Lpu::class, 'lpuid', 'rf_lpuid');
return $this->hasMany(DepartmentMetrikaDefault::class, 'rf_department_id', 'department_id');
}
public function observationPatients(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(ObservationPatient::class, 'rf_department_id', 'department_id');
}
public function reports(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(Report::class, 'rf_department_id', 'department_id');
}
}