fix bug
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
@@ -138,6 +139,12 @@ func (s *Storage) SaveStatus(status *types.Status, dataHash string) error {
|
||||
if order.StockCode == "" {
|
||||
continue
|
||||
}
|
||||
var open_price float64
|
||||
var info types.OrderInfo
|
||||
err = json.Unmarshal([]byte(order.OrderRemark), &info)
|
||||
if err == nil {
|
||||
open_price = info.Op
|
||||
}
|
||||
|
||||
// 查询是否存在
|
||||
var existingOrder models.CollectorOrder
|
||||
@@ -151,6 +158,7 @@ func (s *Storage) SaveStatus(status *types.Status, dataHash string) error {
|
||||
Ymd: ymd,
|
||||
Price: order.Price,
|
||||
Volume: order.Volume,
|
||||
OpenPrice: open_price,
|
||||
TradedPrice: order.TradedPrice,
|
||||
TradedVolume: order.TradedVolume,
|
||||
OrderStatus: order.OrderStatus,
|
||||
|
||||
Reference in New Issue
Block a user