mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 22:13:35 +00:00
12 lines
358 B
C++
12 lines
358 B
C++
|
#include "MySQLDatabase.h"
|
||
|
|
||
|
std::optional<uint32_t> MySQLDatabase::GetDonationTotal(const uint32_t activityId) {
|
||
|
auto donation_total = ExecuteSelect("SELECT SUM(primaryScore) as donation_total FROM leaderboard WHERE game_id = ?;", activityId);
|
||
|
|
||
|
if (!donation_total->next()) {
|
||
|
return std::nullopt;
|
||
|
}
|
||
|
|
||
|
return donation_total->getUInt("donation_total");
|
||
|
}
|