瀏覽代碼

fix pars...

zwxi 6 月之前
父節點
當前提交
ec43a29d2b

+ 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
 }
 

+ 2 - 1
models/base_from_ths_hf.go

@@ -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
 }
 

+ 2 - 1
models/base_from_ths_hf_data.go

@@ -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
 }
 

+ 1 - 1
models/business_conf.go

@@ -157,7 +157,7 @@ func (m *BusinessConf) GetPageItemsByCondition(condition string, pars []interfac
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
-	err = global.DmSQL["master"].Raw(sql, pars, startSize, pageSize).Scan(&items).Error
+	err = global.DmSQL["master"].Raw(sql, pars...).Scan(&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/edb_data_ths_hf.go

@@ -148,7 +148,8 @@ func (m *EdbDataThsHf) GetPageItemsByCondition(condition string, pars []interfac
 		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/edb_data_trade_analysis.go

@@ -148,7 +148,8 @@ func (m *EdbDataTradeAnalysis) 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
 }
 

+ 2 - 1
models/factor_edb_series.go

@@ -142,7 +142,8 @@ func (m *FactorEdbSeries) GetPageItemsByCondition(condition string, pars []inter
 		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_calculate_data_qjjs.go

@@ -150,7 +150,8 @@ func (m *FactorEdbSeriesCalculateDataQjjs) GetPageItemsByCondition(condition str
 		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_func.go

@@ -131,7 +131,8 @@ func (m *FactorEdbSeriesCalculateFunc) 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
 }