Новая логика поисковой выдачи
И добавлена кнопка Добавить карту в архив
This commit is contained in:
@@ -23,16 +23,12 @@ class ArchiveHistory extends Model
|
||||
|
||||
public function updateArchiveInfoStatus()
|
||||
{
|
||||
// Получаем связанную модель через морф
|
||||
$historyable = $this->historyable;
|
||||
|
||||
if (!$historyable) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Проверяем, есть ли у модели архивная информация
|
||||
if (method_exists($historyable, 'archiveInfo') && $historyable->archiveInfo) {
|
||||
$historyable->archiveInfo->update([
|
||||
if ($this->mis_history_id) {
|
||||
$this->misHistory->archiveInfo->update([
|
||||
'status_id' => $this->determineStatusId()
|
||||
]);
|
||||
} else {
|
||||
$this->foxproHistory->archiveInfo->update([
|
||||
'status_id' => $this->determineStatusId()
|
||||
]);
|
||||
}
|
||||
@@ -70,12 +66,12 @@ class ArchiveHistory extends Model
|
||||
|
||||
public function foxproHistory()
|
||||
{
|
||||
return $this->belongsTo(SiMedicalHistory::class, 'keykarta', 'foxpro_history_id');
|
||||
return $this->belongsTo(SiMedicalHistory::class, 'foxpro_history_id', 'keykarta');
|
||||
}
|
||||
|
||||
public function misHistory()
|
||||
{
|
||||
return $this->belongsTo(MisMedicalHistory::class, 'MedicalHistoryID', 'mis_history_id');
|
||||
return $this->belongsTo(MisMedicalHistory::class, 'mis_history_id', 'MedicalHistoryID');
|
||||
}
|
||||
|
||||
public function historyType()
|
||||
|
||||
Reference in New Issue
Block a user