Browse Source

修改数据库连接

xyxie 1 year ago
parent
commit
f5734aefd3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      models/data_manage/trade_position_analysis.go

+ 2 - 2
models/data_manage/trade_position_analysis.go

@@ -273,7 +273,7 @@ func GetExchangeClassify(exchange string) (list []TradeClassifyName, err error)
 
 // GetTradePositionTopCleanByExchangeDataTime 根据时间查询净多单和净空单的值
 func GetTradePositionTopCleanByExchangeDataTime(exchange string, startDate, endDate string) (list []*TradePositionTop, err error) {
-	o := orm.NewOrmUsingDB("data")
+	o := orm.NewOrm()
 	sql := "SELECT * FROM trade_position_" + exchange + "_top where data_time >= ? and data_time <= ? and deal_type in (3,4) ORDER BY classify_name, classify_type, deal_type, data_time, deal_value desc"
 	_, err = o.Raw(sql, startDate, endDate).QueryRows(&list)
 	return
@@ -281,7 +281,7 @@ func GetTradePositionTopCleanByExchangeDataTime(exchange string, startDate, endD
 
 // MultiUpdatePositionTopChangeVal 批量更新榜单里变化量的值
 func MultiUpdatePositionTopChangeVal(exchange string, updates []UpdateChangeVal) (err error) {
-	o := orm.NewOrmUsingDB("data")
+	o := orm.NewOrm()
 	p, err := o.Raw("UPDATE trade_position_" + exchange + "_top SET deal_change=?, modify_time=? WHERE id = ?").Prepare()
 	if err != nil {
 		return