mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Revert "Optimizing ChatRoom::getUsers()"
This reverts commit f8193d1050
.
This commit is contained in:
parent
f8193d1050
commit
f91a03aa32
@ -135,7 +135,7 @@ public function getUsers() {
|
|||||||
$userIDs = array();
|
$userIDs = array();
|
||||||
while ($userIDs[] = $stmt->fetchColumn());
|
while ($userIDs[] = $stmt->fetchColumn());
|
||||||
|
|
||||||
if (empty($userIDs)) return array();
|
if (!count($userIDs)) return array();
|
||||||
|
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
u.*,
|
u.*,
|
||||||
@ -146,15 +146,16 @@ public function getUsers() {
|
|||||||
wcf".WCF_N."_user_storage s
|
wcf".WCF_N."_user_storage s
|
||||||
ON (
|
ON (
|
||||||
u.userID = s.userID
|
u.userID = s.userID
|
||||||
AND s.field = ?
|
AND s.field = ?
|
||||||
AND s.packageID = ?
|
AND s.packageID = ?
|
||||||
)
|
)
|
||||||
WHERE
|
WHERE
|
||||||
u.userID IN (?)
|
u.userID IN (".rtrim(str_repeat('?,', count($userIDs)), ',').")
|
||||||
ORDER BY
|
ORDER BY
|
||||||
u.username ASC";
|
u.username ASC";
|
||||||
$stmt = WCF::getDB()->prepareStatement($sql);
|
$stmt = WCF::getDB()->prepareStatement($sql);
|
||||||
$stmt->execute(array('away', $packageID, $userIDs));
|
array_unshift($userIDs, 'away', $packageID);
|
||||||
|
$stmt->execute($userIDs);
|
||||||
|
|
||||||
return $stmt->fetchObjects('\wcf\data\user\User');
|
return $stmt->fetchObjects('\wcf\data\user\User');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user