Много чего
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user