Fix: maestro main page player count bug
This commit is contained in:
@@ -13,11 +13,12 @@ if($info === null) {
|
||||
send_result_fail();
|
||||
exit;
|
||||
}
|
||||
$playerCount = getPlayerCount($maestroID);
|
||||
|
||||
set_data("name", $info["name"]);
|
||||
set_data("email", $info["email"]);
|
||||
set_data("accountType", $info["accountType"]);
|
||||
set_data("playerCount", $info["playerCount"]);
|
||||
set_data("playerCount", $playerCount);
|
||||
send_result_success();
|
||||
exit;
|
||||
|
||||
@@ -46,4 +47,22 @@ function get_maestro_info($maestroID) {
|
||||
return $info;
|
||||
}
|
||||
|
||||
function getPlayerCount($maestroID) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
SELECT COUNT(PlayerID)
|
||||
FROM player
|
||||
WHERE MaestroID = ? AND AccountType <> 1
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("i", $maestroID);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($playerCount);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
return $playerCount;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user