From 8da46acbce40cc7406134ecfa20bacd53774eeb3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 22 Jul 2026 17:42:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BE=9B=E5=BA=94=E5=95=86=E6=8E=92?= =?UTF-8?q?=E8=A1=8CJOIN=20organization.name=E8=8E=B7=E5=8F=96orgname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sage_datamart/dashboards.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sage_datamart/dashboards.py b/sage_datamart/dashboards.py index 5183937..e312418 100644 --- a/sage_datamart/dashboards.py +++ b/sage_datamart/dashboards.py @@ -247,9 +247,9 @@ async def get_top_models(env, sor, limit=5): async def get_top_providers(env, sor, limit=5): """Top N 供应商(按金额,全量)""" sql = """SELECT f.providerid, COUNT(*) as cnt, COALESCE(SUM(f.amount_cny), 0) as total_amount, - COALESCE(p.name, f.providerid) as provider_name + COALESCE(o.name, f.providerid) as provider_name FROM dm_model_call_fact f - LEFT JOIN modelprovider p ON p.id = f.providerid + LEFT JOIN organization o ON o.id = f.providerid WHERE f.providerid IS NOT NULL GROUP BY f.providerid ORDER BY total_amount DESC LIMIT ${limit}$""" recs = await sor.sqlExe(sql, {'limit': limit})