Files
onboard/app/Models/Department.php
brusnitsyn 9ee33bc517 * блокировка изменения отчета для врача
* вывод данных из отчетов для ролей адм и зав
* поправил ширину стобцов ввода
* добавил календарь на страницу статистики
* переделал календарь у заведующего на странице отчета
* добавил и привязал метрики в статистику
2026-02-03 17:03:37 +09:00

40 lines
999 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Department extends Model
{
public $timestamps = false;
protected $primaryKey = 'department_id';
protected $fillable = [
'name_full',
'name_short',
'rf_mis_department_id',
'rf_department_type'
];
public function metrikaDefault()
{
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');
}
public function departmentType()
{
return $this->belongsTo(DepartmentType::class, 'rf_department_type', 'department_type_id');
}
}