瀏覽代碼

Merge branch 'dm' of http://8.136.199.33:3000/eta_gn_server/eta_index_lib into dm

# Conflicts:
#	models/business_conf.go
xyxie 6 月之前
父節點
當前提交
c4f083c94e

+ 1 - 1
models/base_from_com_trade.go

@@ -89,7 +89,7 @@ func GetComTradeDataByCondition(condition string, pars []interface{}) (item []*C
 		sql1 += condition
 	}
 	sql := `select trade_value AS value,data_time from (` + sql1 + ` having 1 order by modify_time DESC ) tmp GROUP BY data_time ORDER BY data_time DESC `
-	_, err = o.Raw(sql, pars).QueryRows(&item)
+	_, err = o.Raw(sql, pars...).QueryRows(&item)
 	return
 }
 

+ 2 - 1
models/base_from_edb_mapping.go

@@ -182,6 +182,7 @@ func (m *BaseFromEdbMapping) GetPageItemsByCondition(condition string, pars []in
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }

+ 2 - 1
models/base_from_mysteel_chemical.go

@@ -607,7 +607,8 @@ func (m *BaseFromMysteelChemicalIndex) GetIndexPageByFrequency(condition string,
 	}
 	sql += ` LIMIT ?,?  `
 	//_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Scan(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&items).Error
 	return
 }
 

+ 3 - 2
models/base_from_ths_hf.go

@@ -149,7 +149,7 @@ func (m *BaseFromThsHfIndex) RemoveByCondition(condition string, pars []interfac
 	//o := orm.NewOrm()
 	sql := fmt.Sprintf(`DELETE FROM %s WHERE %s`, m.TableName(), condition)
 	//_, err = o.Raw(sql, pars).Exec()
-	err = global.DEFAULT_DmSQL.Exec(sql, pars).Error
+	err = global.DEFAULT_DmSQL.Exec(sql, pars...).Error
 	return
 }
 
@@ -209,7 +209,8 @@ func (m *BaseFromThsHfIndex) GetPageItemsByCondition(condition string, pars []in
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 2
models/base_from_ths_hf_data.go

@@ -105,7 +105,7 @@ func (m *BaseFromThsHfData) RemoveByCondition(condition string, pars []interface
 	//o := orm.NewOrm()
 	sql := fmt.Sprintf(`DELETE FROM %s WHERE %s`, m.TableName(), condition)
 	//_, err = o.Raw(sql, pars).Exec()
-	err = global.DEFAULT_DmSQL.Exec(sql, pars).Error
+	err = global.DEFAULT_DmSQL.Exec(sql, pars...).Error
 	return
 }
 
@@ -165,7 +165,8 @@ func (m *BaseFromThsHfData) GetPageItemsByCondition(condition string, pars []int
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Find(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 1
models/ccf_stock_excel.go

@@ -134,6 +134,7 @@ func (m *CCFStockExcel) GetPageItemsByCondition(condition string, pars []interfa
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Scan(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&items).Error
 	return
 }

+ 2 - 1
models/factor_edb_series_calculate_data.go

@@ -154,7 +154,8 @@ func (m *FactorEdbSeriesCalculateData) GetPageItemsByCondition(condition string,
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Scan(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&items).Error
 	return
 }
 

+ 2 - 1
models/factor_edb_series_chart_mapping.go

@@ -150,7 +150,8 @@ func (m *FactorEdbSeriesChartMapping) GetPageItemsByCondition(condition string,
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Scan(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&items).Error
 	return
 }
 

+ 2 - 1
models/factor_edb_series_mapping.go

@@ -140,7 +140,8 @@ func (m *FactorEdbSeriesMapping) GetPageItemsByCondition(condition string, pars
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars, startSize, pageSize).Scan(&items).Error
+	pars = append(pars, startSize, pageSize)
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&items).Error
 	return
 }