This commit is contained in:
2026-02-27 00:53:07 +08:00
parent db9ef059dc
commit 4dde784047
3 changed files with 5 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ func ClosedTable() {
tw.SetTitle("已清仓列表")
tw.AppendHeader(table.Row{"ID", "Code", "Name", "Open_Date", "Open_Price", "Close_Date", "Close_Price", "PNL/Per", "PNLRate(%)"})
var data []models.MockPosition
impl.DBService.Where("status=?", 1).Find(&data)
impl.DBService.Where("status=?", 1).Order("id asc").Find(&data)
var tPNL, tPNLR, cost, sell float64
for idx, item := range data {
@@ -62,7 +62,7 @@ func UnclosedTableByRealtime() {
tw.SetTitle("未平仓列表(实时)")
tw.AppendHeader(table.Row{"ID", "Code", "Name", "Open_Date", "Open_Price", "Realtime_Price", "PNL/Per", "PNLRate(%)"})
var data []models.MockPosition
impl.DBService.Where("status=?", 0).Find(&data)
impl.DBService.Where("status=?", 0).Order("id asc").Find(&data)
var tPNL, tPNLR, cost, sell float64
for idx, item := range data {
@@ -100,7 +100,7 @@ func UnclosedTableByDay() {
tw.SetTitle("未平仓列表(日线)")
tw.AppendHeader(table.Row{"ID", "Code", "Name", "Open_Date", "Open_Price", "Today_Price", "PNL/Per", "PNLRate(%)"})
var data []models.MockPosition
impl.DBService.Where("status=?", 0).Find(&data)
impl.DBService.Where("status=?", 0).Order("id asc").Find(&data)
var tPNL, tPNLR, cost, sell float64
for idx, item := range data {