From 77971a4eb54834d7a3e7ffe525fc6af07c96873a Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 24 May 2023 21:27:06 +0300 Subject: [PATCH] downgraded csv writer ver --- src/Appwrite/Platform/Tasks/CalcUsersStats.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/CalcUsersStats.php b/src/Appwrite/Platform/Tasks/CalcUsersStats.php index 20d821bc88..3811ca0ff3 100644 --- a/src/Appwrite/Platform/Tasks/CalcUsersStats.php +++ b/src/Appwrite/Platform/Tasks/CalcUsersStats.php @@ -19,7 +19,9 @@ class CalcUsersStats extends Action private array $columns = [ 'Project ID', 'Project Name', - 'Users' + 'Team ID', + 'Team name', + 'Users' ]; protected string $directory = '/usr/local'; @@ -100,6 +102,16 @@ class CalcUsersStats extends Action /** Get Project Name */ $stats['Project Name'] = $project->getAttribute('name'); + + /** Get Team Name and Id */ + $teamId = $project->getAttribute('teamId', null); + if ($teamId) { + $team = $dbForConsole->getDocument('teams', $teamId); + } + + $stats['Team ID'] = $team->getId() ?? 'N/A'; + $stats['Team name'] = $team->getAttribute('name', 'N/A'); + /** Get Total Users */ $stats['users'] = $dbForProject->count('users', [], APP_LIMIT_COUNT);