fix: sqlite3.Row没有.get()方法, r.get('cost',0)静默失败→改为r['cost'] if r['cost'] else 0

This commit is contained in:
知微
2026-07-07 11:05:21 +08:00
parent 7c255d5234
commit 096fbbf5f6
+2 -2
View File
@@ -69,7 +69,7 @@ try:
from strategy_lifecycle import reassess_with_context
result = reassess_with_context(
code, name, r["price"],
r.get("cost", 0), r.get("shares", 0),
r["cost"] if r["cost"] else 0, r["shares"] if r["shares"] else 0,
r["action"] or ""
)
if result and result.get("action"):
@@ -100,7 +100,7 @@ try:
from strategy_lifecycle import reassess_with_context
result = reassess_with_context(
code, name, r["price"],
r.get("cost", 0), r.get("shares", 0),
r["cost"] if r["cost"] else 0, r["shares"] if r["shares"] else 0,
""
)
if result and result.get("action"):