There was an error while loading. Please reload this page.
1 parent 509f62d commit 2c64b71Copy full SHA for 2c64b71
models/mysql/bill_store.go
@@ -44,8 +44,8 @@ func (s *Store) AddBills(bills []*models.Bill) error {
44
}
45
var valueStrings []string
46
for _, bill := range bills {
47
-valueString := fmt.Sprintf("('%v',%v, '%v', %v, %v, '%v', %v, '%v')",
48
-time.Now(), bill.UserId, bill.Currency, bill.Available, bill.Hold, bill.Type, bill.Settled, bill.Notes)
+valueString := fmt.Sprintf("(NOW(),%v, '%v', %v, %v, '%v', %v, '%v')",
+bill.UserId, bill.Currency, bill.Available, bill.Hold, bill.Type, bill.Settled, bill.Notes)
49
valueStrings = append(valueStrings, valueString)
50
51
sql := fmt.Sprintf("INSERT INTO g_bill (created_at, user_id,currency,available,hold, type,settled,notes) VALUES %s", strings.Join(valueStrings, ","))
models/mysql/fill_store.go
@@ -19,7 +19,6 @@ import (
19
"github.com/gitbitex/gitbitex-spot/models"
20
"github.com/jinzhu/gorm"
21
"strings"
22
-"time"
23
)
24
25
func (s *Store) GetLastFillByProductId(productId string) (*models.Fill, error) {
@@ -58,8 +57,8 @@ func (s *Store) AddFills(fills []*models.Fill) error {
58
57
59
60
for _, fill := range fills {
61
-valueString := fmt.Sprintf("('%v', '%v', %v, %v, %v, %v,%v, %v,'%v',%v,%v,'%v',%v,'%v',%v,%v)",
62
-time.Now(), fill.ProductId, fill.TradeId, fill.OrderId, fill.MessageSeq, fill.Size, fill.Price, fill.Funds,
+valueString := fmt.Sprintf("(NOW(), '%v', %v, %v, %v, %v,%v, %v,'%v',%v,%v,'%v',%v,'%v',%v,%v)",
+fill.ProductId, fill.TradeId, fill.OrderId, fill.MessageSeq, fill.Size, fill.Price, fill.Funds,
63
fill.Liquidity, fill.Fee, fill.Settled, fill.Side, fill.Done, fill.DoneReason, fill.LogOffset, fill.LogSeq)
64
65
models/mysql/tick_store.go
func (s *Store) GetTicksByProductId(productId string, granularity int64, limit int) ([]*models.Tick, error) {
@@ -46,8 +45,8 @@ func (s *Store) AddTicks(ticks []*models.Tick) error {
for _, tick := range ticks {
-valueString := fmt.Sprintf("('%v','%v', %v, %v, %v, %v, %v, %v, %v,%v,%v)",
-time.Now(), tick.ProductId, tick.Granularity, tick.Time, tick.Open, tick.Low, tick.High, tick.Close,
+valueString := fmt.Sprintf("(NOW(),'%v', %v, %v, %v, %v, %v, %v, %v,%v,%v)",
+tick.ProductId, tick.Granularity, tick.Time, tick.Open, tick.Low, tick.High, tick.Close,
tick.Volume, tick.LogOffset, tick.LogSeq)
52
53
0 commit comments