1
0
Fork 0
mirror of synced 2024-10-02 18:26:49 +13:00

chore: refactor code

This commit is contained in:
德华 刘 2024-01-22 08:30:48 +00:00
parent ff7523d6db
commit d04f9f41c3

View file

@ -223,7 +223,6 @@ class Hamster extends Action
Query::equal('$internalId', [$teamInternalId]) Query::equal('$internalId', [$teamInternalId])
]); ]);
/** Add billing information */
$billing = $this->getBillingDetails($organization); $billing = $this->getBillingDetails($organization);
$statsPerProject['billing_plan'] = $billing['billing_plan'] ?? null; $statsPerProject['billing_plan'] = $billing['billing_plan'] ?? null;
$statsPerProject['billing_start_date'] = $billing['billing_start_date'] ?? null; $statsPerProject['billing_start_date'] = $billing['billing_start_date'] ?? null;
@ -367,7 +366,6 @@ class Hamster extends Action
/** Organization name */ /** Organization name */
$statsPerOrganization['name'] = $organization->getAttribute('name'); $statsPerOrganization['name'] = $organization->getAttribute('name');
/** Get Email and of the organization owner */ /** Get Email and of the organization owner */
$membership = $dbForConsole->findOne('memberships', [ $membership = $dbForConsole->findOne('memberships', [
Query::equal('teamInternalId', [$organization->getInternalId()]), Query::equal('teamInternalId', [$organization->getInternalId()]),
@ -424,17 +422,17 @@ class Hamster extends Action
try { try {
$statsPerUser = []; $statsPerUser = [];
$statsPerUser['time'] = $user->getAttribute('$time');
/** Add billing information */
$organization = $dbForConsole->findOne('teams', [ $organization = $dbForConsole->findOne('teams', [
Query::equal('userInternalId', [$user->getInternalId()]) Query::equal('userInternalId', [$user->getInternalId()])
]); ]);
/** Add billing information */
$billing = $this->getBillingDetails($organization); $billing = $this->getBillingDetails($organization);
$statsPerUser['billing_plan'] = $billing['billing_plan'] ?? null; $statsPerUser['billing_plan'] = $billing['billing_plan'] ?? null;
$statsPerUser['billing_start_date'] = $billing['billing_start_date'] ?? null; $statsPerUser['billing_start_date'] = $billing['billing_start_date'] ?? null;
$statsPerUser['time'] = $user->getAttribute('$time');
/** Organization name */ /** Organization name */
$statsPerUser['name'] = $user->getAttribute('name'); $statsPerUser['name'] = $user->getAttribute('name');