fix: Standing 无 xgd 属性,用 xg_for - xg_against 计算 xG差
standings_slice._fmt 误用 row.xgd(Standing 无此列),预测时报 AttributeError。 修正:直接用 xg_for - xg_against 计算 xG差,去掉对 goal_diff 的冗余判断。
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user