Профиль хирургии
This commit is contained in:
@@ -102,7 +102,9 @@ class MisMedicalHistory extends Model
|
||||
public function scopeOperationOnBranch($query, $branchId, $startDate, $endDate)
|
||||
{
|
||||
return $this->surgicalOperations()->where('rf_StationarBranchID', $branchId)
|
||||
->whereBetween('Date', [$startDate, $endDate]);
|
||||
->where('Date', '>=', $startDate)
|
||||
->where('Date', '<=', $endDate);
|
||||
// ->whereBetween('Date', [$startDate, $endDate]);
|
||||
}
|
||||
|
||||
public function scopeCurrentlyHospitalized($query)
|
||||
@@ -143,6 +145,13 @@ class MisMedicalHistory extends Model
|
||||
return $this->hasMany(MisMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
|
||||
}
|
||||
|
||||
public function outcomeMigration()
|
||||
{
|
||||
return $this->migrations()
|
||||
->whereDate('DateOut', '<>', '2222-01-01')
|
||||
->orderBy('DateOut', 'desc');
|
||||
}
|
||||
|
||||
/*
|
||||
* Движение по StationarBranch
|
||||
*/
|
||||
@@ -166,7 +175,9 @@ class MisMedicalHistory extends Model
|
||||
->where('sb.rf_DepartmentID', $departmentId);
|
||||
|
||||
if ($startDate && $endDate) {
|
||||
$q->whereBetween('mp.DateIngoing', [$startDate, $endDate]);
|
||||
$q->where('mp.DateIngoing', '>=', $startDate)
|
||||
->where('mp.DateIngoing', '<=', $endDate);
|
||||
// $q->whereBetween('mp.DateIngoing', [$startDate, $endDate]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user