mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-27 07:57:21 +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");
|
||
|
}
|