Роли, переделывание отчета, изменение на главной странице
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user