Skip to content

Commit

Permalink
🐛 Bug fix bot api
Browse files Browse the repository at this point in the history
  • Loading branch information
anditv21 committed Sep 17, 2023
1 parent abfa9a0 commit d5ce347
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/models/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function userAPI($username, $password, $hwid)
protected function getuserbydiscord($dcid)
{
try {
$this->prepare("SELECT `uid`, `username`, `displayname`, `banned`, `admin`, `supp` FROM `users` WHERE `dcid` = ?");
$this->prepare("SELECT `uid`, `username`, `sub` , `displayname`, `banned`, `admin`, `supp` FROM `users` WHERE `dcid` = ?");
$this->statement->execute([$dcid]);
$result = $this->statement->fetch(PDO::FETCH_ASSOC);

Expand Down Expand Up @@ -115,6 +115,7 @@ protected function getuserbydiscord($dcid)
$banned = $result['banned'] ?? '';
$admin = $result['admin'] ?? '';
$supp = $result['supp'] ?? '';
$sub = $result['sub'] ?? '';

$response = [
"uid" => $uid,
Expand All @@ -123,7 +124,8 @@ protected function getuserbydiscord($dcid)
"banned" => $banned,
"admin" => $admin,
"supp" => $supp,
"avatar_url" => $avatarurl
"avatar_url" => $avatarurl,
"sub" => $sub
];
}
} catch (Exception $e) {
Expand Down Expand Up @@ -157,7 +159,7 @@ protected function count_users()
protected function get_linked_users()
{
try {
$this->prepare("SELECT `uid`, `displayname`, `dcid` FROM `users` WHERE `dcid` IS NOT NULL");
$this->prepare("SELECT `uid`, `username` ,`displayname`, `dcid` FROM `users` WHERE `dcid` IS NOT NULL");
$this->statement->execute();
$linked_users = $this->statement->fetchAll(PDO::FETCH_ASSOC);

Expand Down

0 comments on commit d5ce347

Please sign in to comment.