* переписал функции прототипов в сервисы
* оптимизация доставки контента до клиента * переписал запросы выборок * убрал из подсчета переведенных * добавил сохранение метрикам для вывода в дашборд
This commit is contained in:
@@ -34,6 +34,15 @@ class MisMedicalHistory extends Model
|
||||
return $this->hasMany(MisSurgicalOperation::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
|
||||
}
|
||||
|
||||
public function surgicalOperationsInBranch($branchId)
|
||||
{
|
||||
$operations = MisSurgicalOperation::where('rf_MedicalHistoryID', $this->MedicalHistoryID)
|
||||
->where('rf_StationarBranchID', $branchId)
|
||||
->get();
|
||||
|
||||
return $operations;
|
||||
}
|
||||
|
||||
public function scopeOperationOnBranch($query, $branchId, $startDate, $endDate)
|
||||
{
|
||||
return $this->surgicalOperations()->where('rf_StationarBranchID', $branchId)
|
||||
|
||||
Reference in New Issue
Block a user