fix: api_provider_roi JOIN organization.orgname + ChartScatter nameField改为provider_name

This commit is contained in:
yumoqing 2026-07-23 11:54:58 +08:00
parent 698dc940b4
commit 21ad2403a0
2 changed files with 5 additions and 2 deletions

View File

@ -81,7 +81,10 @@ async def api_provider_roi(sor, params_kw=None):
try: try:
model = (params_kw or {}).get('model') model = (params_kw or {}).get('model')
stat_date = (params_kw or {}).get('date') stat_date = (params_kw or {}).get('date')
sql = "SELECT * FROM dm_provider_cost_daily WHERE 1=1" sql = """SELECT p.*, COALESCE(o.orgname, p.providerid) as provider_name
FROM dm_provider_cost_daily p
LEFT JOIN organization o ON o.id = p.providerid
WHERE 1=1"""
ns = {} ns = {}
if stat_date: if stat_date:
sql += " AND stat_date=${stat_date}$" sql += " AND stat_date=${stat_date}$"

View File

@ -3,7 +3,7 @@
"options": { "options": {
"height": "240px", "height": "240px",
"data_url": "/sage_datamart/api/provider_roi.dspy", "data_url": "/sage_datamart/api/provider_roi.dspy",
"nameField": "model", "nameField": "provider_name",
"xField": "unit_price", "xField": "unit_price",
"yField": "avg_ttft_ms", "yField": "avg_ttft_ms",
"sizeField": "total_calls" "sizeField": "total_calls"