From dc8b87e008624c179e3d70c7382d1e80035af4e8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 23 Jan 2024 22:05:14 +0000 Subject: [PATCH] The account overview is now grouped by the account type --- src/Module/Moderation/Summary.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Module/Moderation/Summary.php b/src/Module/Moderation/Summary.php index ec235f155e..a67ce19820 100644 --- a/src/Module/Moderation/Summary.php +++ b/src/Module/Moderation/Summary.php @@ -48,24 +48,23 @@ class Summary extends BaseModeration protected function content(array $request = []): string { parent::content(); - + $accounts = [ - [$this->t('Normal Account'), 0], - [$this->t('Automatic Follower Account'), 0], - [$this->t('Public Group Account'), 0], - [$this->t('Automatic Friend Account'), 0], - [$this->t('Blog Account'), 0], - [$this->t('Private Group Account'), 0] + [$this->t('Personal Page'), 0], + [$this->t('Organisation Page'), 0], + [$this->t('News Page'), 0], + [$this->t('Community Group'), 0], + [$this->t('Channel Relay'), 0], ]; $users = 0; - $pageFlagsCountStmt = $this->database->p('SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `page-flags`', 0); - while ($pageFlagsCount = $this->database->fetch($pageFlagsCountStmt)) { - $accounts[$pageFlagsCount['page-flags']][1] = $pageFlagsCount['count']; - $users += $pageFlagsCount['count']; + $accountTypeCountStmt = $this->database->p('SELECT `account-type`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `account-type`', 0); + while ($AccountTypeCount = $this->database->fetch($accountTypeCountStmt)) { + $accounts[$AccountTypeCount['account-type']][1] = $AccountTypeCount['count']; + $users += $AccountTypeCount['count']; } - $this->database->close($pageFlagsCountStmt); + $this->database->close($accountTypeCountStmt); $this->logger->debug('accounts', ['accounts' => $accounts]);