fix: sqlite3.Row没有.get()方法, r.get('cost',0)静默失败→改为r['cost'] if r['cost'] else 0
This commit is contained in:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user