Explorar o código

fix:替换sql中的双引号

Roc hai 3 meses
pai
achega
8a9cf44c80

+ 1 - 1
models/data_manage/multiple_graph_config.go

@@ -117,7 +117,7 @@ func ReplaceEdbInfoInLineEquationMultipleGraphConfig(oldEdbInfo, newEdbInfo *Edb
 	//替换multiple_graph_config中的指标
 	{
 		multipleGraphConfigList := make([]*MultipleGraphConfig, 0)
-		csql := `SELECT * FROM multiple_graph_config WHERE edb_info_id_a=0 AND edb_info_id_b=0 AND curve !=""`
+		csql := `SELECT * FROM multiple_graph_config WHERE edb_info_id_a=0 AND edb_info_id_b=0 AND curve !=''`
 		_, err = to.Raw(csql).QueryRows(&multipleGraphConfigList)
 		if err != nil {
 			errmsg = "获取指标关联图表配置信息失败:Err:" + err.Error()

+ 2 - 2
models/data_manage/trade_position_analysis.go

@@ -183,13 +183,13 @@ func MultiInsertTradeBaseDataToTop(exchange string, startDate, endDate string) (
 	o := orm.NewOrmUsingDB("data")
 	now := time.Now().Format(utils.FormatDateTime)
 	sql1 := `INSERT INTO trade_position_` + exchange + `_top(classify_name,classify_type,deal_short_name,deal_value,deal_change,data_time,deal_type,source_type,rank,create_time,modify_time)
-	SELECT classify_name,classify_type,buy_short_name,buy_value,buy_change,data_time,1,0,rank,?,? FROM base_from_trade_` + exchange + `_index where rank <50 and buy_short_name !="" and data_time between ? and ?`
+	SELECT classify_name,classify_type,buy_short_name,buy_value,buy_change,data_time,1,0,rank,?,? FROM base_from_trade_` + exchange + `_index where rank <50 and buy_short_name !='' and data_time between ? and ?`
 	_, err = o.Raw(sql1, now, now, startDate, endDate).Exec()
 	if err != nil {
 		return
 	}
 	sql2 := `INSERT INTO trade_position_` + exchange + `_top(classify_name,classify_type,deal_short_name,deal_value,deal_change,data_time,deal_type,source_type,rank,create_time,modify_time)
-SELECT classify_name,classify_type,sold_short_name,sold_value,sold_change,data_time,2,0,rank,?,? FROM base_from_trade_` + exchange + `_index where rank <50 and sold_short_name !="" and data_time between ? and ?`
+SELECT classify_name,classify_type,sold_short_name,sold_value,sold_change,data_time,2,0,rank,?,? FROM base_from_trade_` + exchange + `_index where rank <50 and sold_short_name !='' and data_time between ? and ?`
 	_, err = o.Raw(sql2, now, now, startDate, endDate).Exec()
 	return
 }

+ 2 - 2
models/report.go

@@ -1306,7 +1306,7 @@ func UpdateReportPublishTime(reportId int, videoNameDate string) (err error) {
 		return
 	}
 	//修改音频标题
-	sql2 := ` UPDATE report SET video_name=CONCAT(SUBSTRING_INDEX(video_name,"(",1),"` + videoNameDate + `") WHERE id = ? and (video_name !="" and video_name is not null)`
+	sql2 := ` UPDATE report SET video_name=CONCAT(SUBSTRING_INDEX(video_name,"(",1),"` + videoNameDate + `") WHERE id = ? and (video_name !='' and video_name is not null)`
 	_, err = o.Raw(sql2, reportId).Exec()
 	return
 }
@@ -1319,7 +1319,7 @@ func UpdateReportChapterPublishTime(reportId int, videoNameDate string) (err err
 		return
 	}
 	//修改音频标题
-	sql2 := ` UPDATE report_chapter SET video_name=CONCAT(SUBSTRING_INDEX(video_name,"(",1),"` + videoNameDate + `") WHERE report_id = ? and (video_name !="" and video_name is not null)`
+	sql2 := ` UPDATE report_chapter SET video_name=CONCAT(SUBSTRING_INDEX(video_name,"(",1),"` + videoNameDate + `") WHERE report_id = ? and (video_name !='' and video_name is not null)`
 	_, err = o.Raw(sql2, reportId).Exec()
 	return
 }

+ 1 - 1
models/report_chapter.go

@@ -319,7 +319,7 @@ func GetReportChapterVideoListByReportIds(reportIds []int) (list []*ReportChapte
 			FROM
 				report_chapter
 			WHERE
-				report_id IN (` + utils.GetOrmInReplace(len(reportIds)) + `) AND publish_state = 2 AND video_url != ""
+				report_id IN (` + utils.GetOrmInReplace(len(reportIds)) + `) AND publish_state = 2 AND video_url != ''
 			ORDER BY
 				report_chapter_id ASC `
 	_, err = o.Raw(sql, reportIds).QueryRows(&list)

+ 1 - 1
services/english_report.go

@@ -813,7 +813,7 @@ func MultiEnglishPolicyReportSync() (err error, errMsg string) {
 	var pars []interface{}
 	//startDate := time.Now().Format(utils.FormatDate)
 	startDate := time.Now().AddDate(0, -1, 0).Format(utils.FormatDate)
-	condition += ` AND publish_time >= ? AND state = 1 AND (content !="" AND content is not null)`
+	condition += ` AND publish_time >= ? AND state = 1 AND (content !='' AND content is not null)`
 	pars = append(pars, startDate)
 	policyReports, err := models.GetEnglishPolicyReportByCondition(condition, pars)
 	if err != nil {