Fix Get agent balance

This commit is contained in:
2025-05-20 22:42:06 +07:00
parent e866ef3303
commit 2ee1322ba0
4 changed files with 59 additions and 25 deletions

View File

@@ -49,7 +49,8 @@ public class AgentBalanceRepository : IAgentBalanceRepository
$"|> range(start: {start:s}Z" +
(end.HasValue ? $", stop: {end.Value:s}Z" : "") +
$") " +
$"|> filter(fn: (r) => r[\"agent_name\"] == \"{agentName}\")";
$"|> filter(fn: (r) => r[\"agent_name\"] == \"{agentName}\") " +
$"|> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")";
var result = await query.QueryAsync<AgentBalanceDto>(flux, _influxDbRepository.Organization);