From d04f9f41c3fb3e665b3a5d279428105739e515c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Mon, 22 Jan 2024 08:30:48 +0000 Subject: [PATCH] chore: refactor code --- src/Appwrite/Platform/Workers/Hamster.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Hamster.php b/src/Appwrite/Platform/Workers/Hamster.php index e96748beef..ab2b6e6031 100644 --- a/src/Appwrite/Platform/Workers/Hamster.php +++ b/src/Appwrite/Platform/Workers/Hamster.php @@ -223,7 +223,6 @@ class Hamster extends Action Query::equal('$internalId', [$teamInternalId]) ]); - /** Add billing information */ $billing = $this->getBillingDetails($organization); $statsPerProject['billing_plan'] = $billing['billing_plan'] ?? null; $statsPerProject['billing_start_date'] = $billing['billing_start_date'] ?? null; @@ -367,7 +366,6 @@ class Hamster extends Action /** Organization name */ $statsPerOrganization['name'] = $organization->getAttribute('name'); - /** Get Email and of the organization owner */ $membership = $dbForConsole->findOne('memberships', [ Query::equal('teamInternalId', [$organization->getInternalId()]), @@ -424,17 +422,17 @@ class Hamster extends Action try { $statsPerUser = []; + $statsPerUser['time'] = $user->getAttribute('$time'); + + /** Add billing information */ $organization = $dbForConsole->findOne('teams', [ Query::equal('userInternalId', [$user->getInternalId()]) ]); - /** Add billing information */ $billing = $this->getBillingDetails($organization); $statsPerUser['billing_plan'] = $billing['billing_plan'] ?? null; $statsPerUser['billing_start_date'] = $billing['billing_start_date'] ?? null; - $statsPerUser['time'] = $user->getAttribute('$time'); - /** Organization name */ $statsPerUser['name'] = $user->getAttribute('name');