|
@@ -24,6 +24,9 @@ class DashboardService
|
|
|
'novos_mes' => PartnerAgreement::whereMonth('created_at', now()->month)->whereYear('created_at', now()->year)->count(),
|
|
'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(),
|
|
'associados_pendentes' => User::where('type', UserTypeEnum::ASSOCIADO)->where('status', UserStatusEnum::PENDING)->count(),
|
|
|
'ultimos_acessos' => UserAccessLog::distinct('user_id')->count('user_id'),
|
|
'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'),
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|