# llm_project_cost_query.dspy — 按项目统计费用(2026-09-10 用户定夺) # Tabular data_url 端点:出参必须是 {total, rows}(PageDataLoader 契约), # 模块函数返回 {success, rows, summary} → 此处重排;查询本身 LIMIT 500 不分页, # total=len(rows) 即真实总数。summary 以 tailer 不适用,直接丢弃(页面顶部 # 统计如需再加)。 # 入参 params_kw: date_from? / date_to? / status?(InlineForm 查询按钮注入) uid = await get_user() if not uid: return {"total": 0, "rows": []} pk = dict(params_kw or {}) data = json.loads(await llm_project_cost_query(pk)) if not data.get('success'): return {"total": 0, "rows": []} rows = data.get('rows') or [] return {"total": len(rows), "rows": rows}