修复翻倍/目标位平仓把备注写进平仓时间:纠正 SQL 参数顺序并自动对调历史坏数据。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-09-16 05:48:43 +08:00
parent a38a89e274
commit bd4adc9eca
3 changed files with 70 additions and 5 deletions
+6 -1
View File
@@ -715,9 +715,13 @@ def ensure_local_review_synced(
backfill_exchange_pnl: bool = True,
) -> dict[str, Any]:
"""列表/统计前轻量刷新本地源;有交易所时先用历史仓位盈亏覆盖本地再导入复盘."""
from lib.options.options_time_lib import migrate_options_utc_wall_clock_to_app
from lib.options.options_time_lib import (
migrate_options_utc_wall_clock_to_app,
repair_swapped_closed_at_signal_note,
)
ts_migrate = migrate_options_utc_wall_clock_to_app(conn)
note_swap = repair_swapped_closed_at_signal_note(conn)
if backfill_exchange_pnl and ex is not None:
try:
from lib.exchange.okx_options_lib import fetch_all_option_positions_history
@@ -739,6 +743,7 @@ def ensure_local_review_synced(
except Exception:
out["repaired_usdt"] = 0
out["ts_migrate"] = ts_migrate
out["note_swap"] = note_swap
return out