Sfoglia il codice sorgente

feat: :sparkles: adicionar numero de pessoas que ja acessaram o app

joykepler 6 giorni fa
parent
commit
616d631367
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      app/Services/DashboardService.php

+ 3 - 0
app/Services/DashboardService.php

@@ -24,6 +24,9 @@ class DashboardService
       'novos_mes'           => PartnerAgreement::whereMonth('created_at', now()->month)->whereYear('created_at', now()->year)->count(),
       'associados_pendentes' => User::where('type', UserTypeEnum::ASSOCIADO)->where('status', UserStatusEnum::PENDING)->count(),
       'ultimos_acessos'     => UserAccessLog::distinct('user_id')->count('user_id'),
+      'associados_com_acesso_app' => UserAccessLog::whereHas('user', fn ($q) => $q->where('type', UserTypeEnum::ASSOCIADO))
+        ->distinct('user_id')
+        ->count('user_id'),
     ];
   }