* закончил окно редактирования карты с назначением номера в архиве

* добавил окно для редактирования выдачи / возврата карты
* раздробил логику хранения карты
This commit is contained in:
brusnitsyn
2025-12-05 18:04:02 +09:00
parent 2dfa45707c
commit 2e1b5a3d0e
17 changed files with 431 additions and 13 deletions

View File

@@ -22,4 +22,9 @@ class ArchiveHistory extends Model
{
return $this->morphTo();
}
public function org(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Org::class);
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ArchiveInfo extends Model
{
protected $fillable = [
'historyable_type',
'historyable_id',
'num',
'post_in',
'status_id'
];
public function historyable()
{
return $this->morphTo();
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ArchiveStatus extends Model
{
public $timestamps = false;
protected $fillable = [
'text',
'variant',
'has_user_set'
];
}

View File

@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class Org extends Model
{
protected $fillable = [
'code',
'name'
];
}

View File

@@ -3,6 +3,7 @@
namespace App\Models\SI;
use App\Models\ArchiveHistory;
use App\Models\ArchiveInfo;
use Illuminate\Database\Eloquent\Model;
class SttMedicalHistory extends Model
@@ -33,6 +34,11 @@ class SttMedicalHistory extends Model
return $this->morphMany(ArchiveHistory::class, 'historyable');
}
public function archiveInfo()
{
return $this->morphOne(ArchiveInfo::class, 'historyable');
}
public function scopeSearch($query, $searchText)
{
return $query->where(function($q) use ($searchText) {