Изменения в основном report
This commit is contained in:
@@ -47,7 +47,7 @@ class MedicalHistorySnapshot extends Model
|
||||
|
||||
public function medicalHistory()
|
||||
{
|
||||
return $this->belongsTo(MisMedicalHistory::class, 'rf_medicalhistory_id', 'MedicalHistoryID');
|
||||
return $this->belongsTo(MedicalHistory::class, 'rf_medicalhistory_id', 'original_id');
|
||||
}
|
||||
|
||||
public function departmentPatient()
|
||||
@@ -68,8 +68,8 @@ class MedicalHistorySnapshot extends Model
|
||||
|
||||
public function scopeByDepartment($query, $departmentId)
|
||||
{
|
||||
return $query->whereHas('medicalHistory.migrations.branch', function ($q) use ($departmentId) {
|
||||
$q->where('rf_DepartmentID', $departmentId);
|
||||
return $query->whereHas('medicalHistory.migrations', function ($q) use ($departmentId) {
|
||||
$q->department($departmentId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user