Много чего

This commit is contained in:
brusnitsyn
2025-12-25 17:30:50 +09:00
parent c4bb7ec6f9
commit a5209f45c8
25 changed files with 1521 additions and 574 deletions

View File

@@ -2,6 +2,8 @@
namespace App\Models;
use App\Models\Mis\SttMedicalHistory as MisMedicalHistory;
use App\Models\SI\SttMedicalHistory as SiMedicalHistory;
use Illuminate\Database\Eloquent\Model;
class ArchiveInfo extends Model
@@ -16,17 +18,30 @@ class ArchiveInfo extends Model
protected $connection = 'pgsql';
protected $table = 'archive_infos';
protected $fillable = [
'historyable_type',
'historyable_id',
'num',
'foxpro_history_id',
'mis_history_id',
'foxpro_num',
'mis_num',
'archive_num',
'post_in',
'status_id'
];
public function historyable()
public function foxproHistory()
{
return $this->morphTo();
return $this->belongsTo(SiMedicalHistory::class, 'foxpro_history_id', 'keykarta');
}
public function misHistory()
{
return $this->belongsTo(MisMedicalHistory::class, 'mis_history_id', 'MedicalHistoryID');
}
public function historyType()
{
return $this->mis_history_id !== null ? 'mis' : 'foxpro';
}
public function status()