From 1a9dc63edd19e48aca61e2028f858b6cefbf1e6d Mon Sep 17 00:00:00 2001 From: shangfangjian Date: Tue, 22 Sep 2026 10:52:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Standing=20=E6=97=A0=20xgd=20=E5=B1=9E?= =?UTF-8?q?=E6=80=A7,=E7=94=A8=20xg=5Ffor=20-=20xg=5Fagainst=20=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=20xG=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit standings_slice._fmt 误用 row.xgd(Standing 无此列),预测时报 AttributeError。 修正:直接用 xg_for - xg_against 计算 xG差,去掉对 goal_diff 的冗余判断。 --- src/llm/slices/standings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llm/slices/standings.py b/src/llm/slices/standings.py index 4092c32..e580927 100644 --- a/src/llm/slices/standings.py +++ b/src/llm/slices/standings.py @@ -59,7 +59,7 @@ async def standings_slice(header: MatchHeader, *, before=None, db: AsyncSession n_records = 0 def _fmt(row) -> str: - zg = f" xG差 {row.xgd:+.1f}" if row.xg_for is not None and row.xg_against is not None and row.goal_diff is not None else "" + zg = f" xG差 {row.xg_for - row.xg_against:+.1f}" if row.xg_for is not None and row.xg_against is not None else "" form = f" 近5场 {row.form}" if row.form else "" zone = f" [{row.zone}]" if row.zone else "" return (