Много чего
This commit is contained in:
@@ -11,6 +11,11 @@ class SttMedicalHistory extends Model
|
||||
{
|
||||
protected $primaryKey = 'MedicalHistoryID';
|
||||
protected $table = 'stt_medicalhistory';
|
||||
protected $keyType = 'string';
|
||||
|
||||
protected $casts = [
|
||||
'MedicalHistoryID' => 'string',
|
||||
];
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
@@ -19,12 +24,12 @@ class SttMedicalHistory extends Model
|
||||
|
||||
public function archiveHistory()
|
||||
{
|
||||
return $this->morphMany(ArchiveHistory::class, 'historyable');
|
||||
return $this->hasMany(ArchiveHistory::class, 'mis_history_id', 'MedicalHistoryID');
|
||||
}
|
||||
|
||||
public function archiveInfo()
|
||||
{
|
||||
return $this->morphOne(ArchiveInfo::class, 'historyable');
|
||||
return $this->hasOne(ArchiveInfo::class, 'mis_history_id', 'MedicalHistoryID');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,7 +46,6 @@ class SttMedicalHistory extends Model
|
||||
|
||||
$hasNotBadStatus = $this->archiveInfo()
|
||||
->whereNotNull('status_id')
|
||||
->whereNot('status_id', 1)
|
||||
->whereNot('status_id', 3)
|
||||
->whereNot('status_id', 4)
|
||||
->exists();
|
||||
|
||||
Reference in New Issue
Block a user