Форматирование

This commit is contained in:
brusnitsyn
2026-04-24 16:46:10 +09:00
parent fd0e6ee817
commit 63daa62888
87 changed files with 1380 additions and 791 deletions

View File

@@ -9,7 +9,9 @@ use Illuminate\Support\Facades\DB;
class MisMedicalHistory extends Model
{
protected $table = 'stt_medicalhistory';
protected $primaryKey = 'MedicalHistoryID';
public $timestamps = false;
protected $fillable = [
@@ -18,12 +20,12 @@ class MisMedicalHistory extends Model
'Name',
'OT',
'BD',
'Address'
'Address',
];
protected $casts = [
'DateRecipient' => 'datetime',
'DateExtract' => 'datetime'
'DateExtract' => 'datetime',
];
/**
@@ -45,7 +47,7 @@ class MisMedicalHistory extends Model
*/
public function getActualDischargeDate(): ?Carbon
{
if (!$this->DateExtract) {
if (! $this->DateExtract) {
return null;
}
@@ -62,7 +64,7 @@ class MisMedicalHistory extends Model
*/
public function getBedDays(): int
{
if (!$this->DateRecipient) {
if (! $this->DateRecipient) {
return 0;
}
@@ -106,15 +108,15 @@ class MisMedicalHistory extends Model
return $this->surgicalOperations()->where('rf_StationarBranchID', $branchId)
->where('Date', '>=', $startDate)
->where('Date', '<=', $endDate);
// ->whereBetween('Date', [$startDate, $endDate]);
// ->whereBetween('Date', [$startDate, $endDate]);
}
public function scopeCurrentlyHospitalized($query)
{
return $query->where(function ($builder) {
$builder->whereDate('DateExtract', '1900-01-01')
->orWhereDate('DateExtract', '2222-01-01');
})
$builder->whereDate('DateExtract', '1900-01-01')
->orWhereDate('DateExtract', '2222-01-01');
})
->where('MedicalHistoryID', '<>', 0);
}
@@ -188,7 +190,7 @@ class MisMedicalHistory extends Model
if ($startDate && $endDate) {
$q->where('mp.DateIngoing', '>=', $startDate)
->where('mp.DateIngoing', '<=', $endDate);
// $q->whereBetween('mp.DateIngoing', [$startDate, $endDate]);
// $q->whereBetween('mp.DateIngoing', [$startDate, $endDate]);
}
});
}