|
|
@@ -201,24 +201,28 @@ func QueryHistoryDatas(c *gin.Context) {
|
|
|
// 判断最后周期是否已经存在盘面周期
|
|
|
hd := rst[len(rst)-1]
|
|
|
if hd.TimeStamp.Before(fisrtDate) {
|
|
|
- historyData := HistoryData{
|
|
|
- Opened: utils.IntToFloat64(int(v.Opened), dcplace),
|
|
|
- Highest: utils.IntToFloat64(int(v.Highest), dcplace),
|
|
|
- Lowest: utils.IntToFloat64(int(v.Lowest), dcplace),
|
|
|
- Closed: utils.IntToFloat64(int(v.Last), dcplace),
|
|
|
- TotleVolume: int(v.Totalvolume),
|
|
|
- TotleTurnover: float64(v.Totalturnover),
|
|
|
- HoldVolume: int(v.Holdvolume),
|
|
|
- Settle: utils.IntToFloat64(int(v.Settle), dcplace),
|
|
|
- TimeStamp: fisrtDate,
|
|
|
- }
|
|
|
-
|
|
|
- if req.IsAsc {
|
|
|
- rst = append(rst, historyData)
|
|
|
- } else {
|
|
|
- // 插入第一条
|
|
|
- rear := append([]HistoryData{}, rst[0:]...)
|
|
|
- rst = append(append(rst[:0], historyData), rear...)
|
|
|
+ // #3424 当日未开市显示了K线
|
|
|
+ // 修改:这里增加判断盘面是否有开盘价
|
|
|
+ if v.Opened > 0 {
|
|
|
+ historyData := HistoryData{
|
|
|
+ Opened: utils.IntToFloat64(int(v.Opened), dcplace),
|
|
|
+ Highest: utils.IntToFloat64(int(v.Highest), dcplace),
|
|
|
+ Lowest: utils.IntToFloat64(int(v.Lowest), dcplace),
|
|
|
+ Closed: utils.IntToFloat64(int(v.Last), dcplace),
|
|
|
+ TotleVolume: int(v.Totalvolume),
|
|
|
+ TotleTurnover: float64(v.Totalturnover),
|
|
|
+ HoldVolume: int(v.Holdvolume),
|
|
|
+ Settle: utils.IntToFloat64(int(v.Settle), dcplace),
|
|
|
+ TimeStamp: fisrtDate,
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.IsAsc {
|
|
|
+ rst = append(rst, historyData)
|
|
|
+ } else {
|
|
|
+ // 插入第一条
|
|
|
+ rear := append([]HistoryData{}, rst[0:]...)
|
|
|
+ rst = append(append(rst[:0], historyData), rear...)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|