Skip to content

Commit

Permalink
MBS-9341: Fix SQL in overview table regarding model
Browse files Browse the repository at this point in the history
  • Loading branch information
PhMemmel committed Sep 13, 2024
1 parent cbbf0f9 commit 0429ffd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/local/statistics_overview_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public function __construct(
$this->define_headers($headers);
$this->collapsible(false);

$fields = 'model, modelinfo, COUNT(modelinfo) AS requestcount, SUM(value) AS userusage';
$fields = 'modelinfo, model, COUNT(modelinfo) AS requestcount, SUM(value) AS userusage';
$from = '{local_ai_manager_request_log} rl JOIN {user} u ON rl.userid = u.id';
$tenantfield = get_config('local_ai_manager', 'tenantcolumn');
$tenant = \core\di::get(tenant::class);
$where = 'u.' . $tenantfield . ' = :tenant GROUP BY modelinfo';
$where = 'u.' . $tenantfield . ' = :tenant GROUP BY modelinfo, model';
$params = ['tenant' => $tenant->get_sql_identifier()];
$this->set_sql($fields, $from, $where, $params);
$this->set_count_sql('SELECT COUNT(DISTINCT modelinfo) FROM {local_ai_manager_request_log} rl'
Expand Down

0 comments on commit 0429ffd

Please sign in to comment.