@@ -2003,6 +2003,7 @@ func GetBaseIndexDataMinMax(source, subSource int, indexCode string) (item *Base
sql = `SELECT value AS latest_value FROM %s WHERE index_code = ? ORDER BY data_time DESC LIMIT 1`
sql = fmt.Sprintf(sql, dataTable)
+ sql = utils.ReplaceDriverKeywords("", sql)
if err = o.Raw(sql, indexCode).Scan(&latestVal).Error; err != nil {
return
}
@@ -34,6 +34,7 @@ func GetOpenIdArrByClassifyId(classifyId int) (items []string, err error) {
AND g.from='rddp'
AND g.classify_id=?
ORDER BY FIELD(c.company_id, 16) DESC, ur.user_record_id ASC `
o := global.DbMap[utils.DbNameWeekly]
err = o.Raw(sql, classifyId).Find(&items).Error
@@ -330,8 +330,10 @@ func ReplaceDriverKeywords(driver string, sql string) string {
"value": `"value"`,
"exchange": `"exchange"`,
"size": `"size"`,
- "a.from": `a."from"`,
- "b.from": `b."from"`,
+ // 查询的from可能会有个别地方是小写, 所以这里不加而是把字段的from统一改为*.from处理
+ "a.from": `a."from"`,
+ "b.from": `b."from"`,
+ "g.from": `g."from"`,
},
replacements, ok := rules[dbDriver]