1、
This commit is contained in:
@ -543,7 +543,7 @@ func handleMainOrderFilled(db *gorm.DB, preOrder *DbModels.LinePreOrder) {
|
||||
if err != nil {
|
||||
logger.Errorf("取消未成交订单失败, 交易对:%s 主单号:%s, 错误信息:%v", preOrder.Symbol, preOrder.MainId, err)
|
||||
} else if len(mainIds) > 0 {
|
||||
if err := db.Exec("UPDATE line_pre_order SET status=4,desc=desc +' 新单触发取消' WHERE id IN ? AND status =6", mainIds).Error; err != nil {
|
||||
if err := db.Exec("UPDATE line_pre_order SET `status`=4,`desc`=CONCAT(`desc`, ' 新单触发取消') WHERE id IN ? AND `status` =6", mainIds).Error; err != nil {
|
||||
logger.Errorf("新下单成功后更新主单取消状态失败, 新主单号:%s, 错误信息:%v", preOrder.MainId, err)
|
||||
}
|
||||
}
|
||||
@ -770,7 +770,7 @@ func processTakeProfitOrder(db *gorm.DB, spotApi SpotRestApi, order models.LineP
|
||||
logger.Error("更新现货止盈单触发事件 ordersn:", order.OrderSn)
|
||||
}
|
||||
if err := db.Model(&DbModels.LinePreOrder{}).Where("id = ? and status ='0'", order.Id).
|
||||
Updates(map[string]interface{}{"status": "1", "num": order.Num}).Error; err != nil {
|
||||
Updates(map[string]interface{}{"status": "1", "num": order.Num, "price": order.Price}).Error; err != nil {
|
||||
logger.Error("现货止盈下单成功,更新状态失败:", order.OrderSn, " err:", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user