Обновлен стартовый экран
Переписаны запросы для статистики, отчетов Добавлена интеграция отчета сестры
This commit is contained in:
@@ -104,10 +104,10 @@ class FillReportsFromDate extends Command
|
||||
->whereHas('departments', function ($departmentQuery) use ($department) {
|
||||
$departmentQuery->where('rf_department_id', $department->department_id);
|
||||
})
|
||||
->whereHas('roles', function ($roleQuery) {
|
||||
$roleQuery->where('slug', 'doctor');
|
||||
->whereHas('appRoles', function ($roleQuery) {
|
||||
$roleQuery->where('slug', 'dej');
|
||||
})
|
||||
->with(['roles', 'departments']);
|
||||
->with(['appRoles', 'departments']);
|
||||
|
||||
if ($userId) {
|
||||
return $query->where('id', $userId)->first();
|
||||
@@ -116,7 +116,7 @@ class FillReportsFromDate extends Command
|
||||
return $query->get()
|
||||
->sortBy(function (User $user) use ($department) {
|
||||
$departmentLink = $user->departments->firstWhere('rf_department_id', $department->department_id);
|
||||
$isDoctor = $user->roles->contains('slug', 'doctor');
|
||||
$isDoctor = $user->appRoles->contains('slug', 'dej');
|
||||
$isFavorite = (bool) optional($departmentLink)->is_favorite;
|
||||
$order = optional($departmentLink)->order ?? PHP_INT_MAX;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user