From 58e3e98031241892c82e325e132e46b343cb1f5e Mon Sep 17 00:00:00 2001 From: fish Date: Fri, 24 Jul 2026 22:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E7=BA=A6=E6=95=B0=E6=8D=AE=E6=8C=89?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=80=92=E5=BA=8F=E6=8E=92=E5=88=97=EF=BC=8C?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=9C=A8=E6=9C=80=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ft-app/app/routers/contracts.py | 4 ++-- ft-app/app/templates/contract.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ft-app/app/routers/contracts.py b/ft-app/app/routers/contracts.py index 042f07f..38759a2 100644 --- a/ft-app/app/routers/contracts.py +++ b/ft-app/app/routers/contracts.py @@ -59,7 +59,7 @@ def contract_detail(request: Request, contract: str, db: Session = Depends(get_d bars = ( db.query(DailyBar) .filter(DailyBar.contract == contract.upper()) - .order_by(DailyBar.date) + .order_by(DailyBar.date.desc()) .all() ) @@ -77,7 +77,7 @@ def contract_detail(request: Request, contract: str, db: Session = Depends(get_d "has_amp": bar.amp_5d is not None, }) - latest = bars[-1] if bars else None + latest = bars[0] if bars else None template = request.app.state.templates.get_template("contract.html") return HTMLResponse( diff --git a/ft-app/app/templates/contract.html b/ft-app/app/templates/contract.html index 48ad42d..c94584a 100644 --- a/ft-app/app/templates/contract.html +++ b/ft-app/app/templates/contract.html @@ -37,7 +37,7 @@ {% for row in rows %} - = 7 %} class="extra-row" style="display:none;"{% endif %}> + = 7 %} class="extra-row" style="display:none;"{% endif %}>
日期星期开盘收盘最高最低波幅5日均振幅
{{ row.date }} {{ row.weekday }} {{ row.open }}