Новая логика поисковой выдачи

И добавлена кнопка Добавить карту в архив
This commit is contained in:
brusnitsyn
2025-12-26 17:41:25 +09:00
parent 329304076d
commit c5c1a2b3e1
14 changed files with 508 additions and 38 deletions

View File

@@ -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()