Обновлен стартовый экран

Переписаны запросы для статистики, отчетов
Добавлена интеграция отчета сестры
This commit is contained in:
brusnitsyn
2026-05-28 22:10:00 +09:00
parent 90e0d04dfd
commit 739168d427
96 changed files with 6663 additions and 1465 deletions

View File

@@ -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;