feat(admin): Nutzungsstatistik um "mit Websuche" je Nutzer
get_all_usage liefert total_web_searches (Summe aus web_search_usage); Statistik-Tabelle + Gesamtzeile zeigen die neue Spalte "mit Websuche". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
d738921d25
commit
d74e94e6a4
2 changed files with 7 additions and 1 deletions
|
|
@ -643,7 +643,9 @@ class SQLiteStore(Store):
|
|||
rows = conn.execute(
|
||||
"SELECT u.user_id, COALESCE(usr.display_name, u.user_id) AS display_name,"
|
||||
" SUM(u.requests) AS total_requests, SUM(u.units) AS total_units,"
|
||||
" MAX(u.day) AS last_active"
|
||||
" MAX(u.day) AS last_active,"
|
||||
" COALESCE((SELECT SUM(w.count) FROM web_search_usage w"
|
||||
" WHERE w.user_id = u.user_id), 0) AS total_web_searches"
|
||||
" FROM usage u LEFT JOIN users usr ON usr.id = u.user_id"
|
||||
" GROUP BY u.user_id ORDER BY total_requests DESC",
|
||||
).fetchall()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue