genlong 5 mēneši atpakaļ
vecāks
revīzija
8a5a7aa687

+ 4 - 4
models/classify.go

@@ -267,7 +267,7 @@ func GetClassifyList(keyWord string, enabled int) (items []*ClassifyList, err er
 
 	//o := orm.NewOrmUsingDB("rddp")
 	//_, err = o.Raw(sql, pars...).QueryRows(&items)
-	err = global.DmSQL["rddp"].Raw(sql, pars).Find(&items).Error
+	err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -301,7 +301,7 @@ func GetClassifyListCount(keyWord, companyType string, hideDayWeek int) (count i
 	}
 	//o := orm.NewOrmUsingDB("rddp")
 	//err = o.Raw(sqlCount, pars...).QueryRow(&count)
-	err = global.DmSQL["rddp"].Raw(sqlCount, pars).Scan(&count).Error
+	err = global.DmSQL["rddp"].Raw(sqlCount, pars...).Scan(&count).Error
 	return
 }
 
@@ -365,7 +365,7 @@ func GetClassifyChildByParentIds(parentId []int, keyWord string, enabled int) (i
 	sql += ` ORDER BY create_time ASC `
 	//o := orm.NewOrmUsingDB("rddp")
 	//_, err = o.Raw(sql, pars...).QueryRows(&items)
-	err = global.DmSQL["rddp"].Raw(sql, pars).Find(&items).Error
+	err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -426,7 +426,7 @@ func GetClassifyByCondition(condition, orderRule string, pars []interface{}) (it
 	sql += ` ORDER BY ` + order
 	//o := orm.NewOrmUsingDB("rddp")
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DmSQL["rddp"].Raw(sql, pars).Find(&items).Error
+	err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 1 - 1
models/cloud_disk_menu.go

@@ -71,7 +71,7 @@ func (m *CloudDiskMenu) GetItemsByCondition(condition string, pars []interface{}
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 1 - 1
models/cloud_disk_resource.go

@@ -100,7 +100,7 @@ func (m *CloudDiskResource) GetItemsByCondition(condition string, pars []interfa
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 2
models/semantic_analysis/sa_label.go

@@ -110,7 +110,7 @@ func (m *SaLabel) GetItemsByCondition(condition string, pars []interface{}, fiel
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -129,7 +129,7 @@ func (m *SaLabel) GetPageItemsByCondition(startSize, pageSize int, condition str
 	//if err = o.Raw(totalSql, pars).QueryRow(&total); err != nil {
 	//	return
 	//}
-	err = global.DEFAULT_DmSQL.Raw(totalSql, pars).Scan(&total).Error
+	err = global.DEFAULT_DmSQL.Raw(totalSql, pars...).Scan(&total).Error
 	if err != nil {
 		return
 	}

+ 3 - 3
models/smart_report/smart_report.go

@@ -127,14 +127,14 @@ func (m *SmartReport) GetItemByCondition(condition string, pars []interface{}, o
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
-	err = o.Raw(sql, pars).QueryRow(&item)
+	err = o.Raw(sql, pars...).QueryRow(&item)
 	return
 }
 
 func (m *SmartReport) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
-	err = o.Raw(sql, pars).QueryRow(&count)
+	err = o.Raw(sql, pars...).QueryRow(&count)
 	return
 }
 
@@ -149,7 +149,7 @@ func (m *SmartReport) GetItemsByCondition(condition string, pars []interface{},
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	_, err = o.Raw(sql, pars).QueryRows(&items)
+	_, err = o.Raw(sql, pars...).QueryRows(&items)
 	return
 }
 

+ 2 - 2
models/smart_report/smart_report_save_log.go

@@ -87,7 +87,7 @@ func (m *SmartReportSaveLog) GetItemByCondition(condition string, pars []interfa
 func (m *SmartReportSaveLog) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
-	err = o.Raw(sql, pars).QueryRow(&count)
+	err = o.Raw(sql, pars...).QueryRow(&count)
 	return
 }
 
@@ -102,7 +102,7 @@ func (m *SmartReportSaveLog) GetItemsByCondition(condition string, pars []interf
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
-	_, err = o.Raw(sql, pars).QueryRows(&items)
+	_, err = o.Raw(sql, pars...).QueryRows(&items)
 	return
 }
 

+ 2 - 2
models/smart_report/smart_resource.go

@@ -66,7 +66,7 @@ type SmartReportResourceListResp struct {
 func (m *SmartReportResource) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
-	err = o.Raw(sql, pars).QueryRow(&count)
+	err = o.Raw(sql, pars...).QueryRow(&count)
 	return
 }
 
@@ -102,7 +102,7 @@ func (m *SmartReportResource) GetItemsByCondition(condition string, pars []inter
 	order := ` ORDER BY create_time DESC`
 
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s `, fields, m.TableName(), condition, order)
-	_, err = o.Raw(sql, pars).QueryRows(&items)
+	_, err = o.Raw(sql, pars...).QueryRows(&items)
 	return
 }
 

+ 3 - 3
models/speech_recognition/speech_recognition.go

@@ -165,7 +165,7 @@ func (m *SpeechRecognition) GetItemByCondition(condition string, pars []interfac
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -173,7 +173,7 @@ func (m *SpeechRecognition) GetCountByCondition(condition string, pars []interfa
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -189,7 +189,7 @@ func (m *SpeechRecognition) GetItemsByCondition(condition string, pars []interfa
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 3
models/speech_recognition/speech_recognition_api_log.go

@@ -134,7 +134,7 @@ func (m *SpeechRecognitionApiLog) GetItemByCondition(condition string, pars []in
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -142,7 +142,7 @@ func (m *SpeechRecognitionApiLog) GetCountByCondition(condition string, pars []i
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -158,7 +158,7 @@ func (m *SpeechRecognitionApiLog) GetItemsByCondition(condition string, pars []i
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 3
models/speech_recognition/speech_recognition_content.go

@@ -126,7 +126,7 @@ func (m *SpeechRecognitionContent) GetItemByCondition(condition string, pars []i
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -134,7 +134,7 @@ func (m *SpeechRecognitionContent) GetCountByCondition(condition string, pars []
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -150,7 +150,7 @@ func (m *SpeechRecognitionContent) GetItemsByCondition(condition string, pars []
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 4 - 4
models/speech_recognition/speech_recognition_menu.go

@@ -131,7 +131,7 @@ func (m *SpeechRecognitionMenu) GetItemByCondition(condition string, pars []inte
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -139,7 +139,7 @@ func (m *SpeechRecognitionMenu) GetCountByCondition(condition string, pars []int
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -155,7 +155,7 @@ func (m *SpeechRecognitionMenu) GetItemsByCondition(condition string, pars []int
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 
@@ -277,6 +277,6 @@ func (m *SpeechRecognitionMenu) UpdateChildByParentMenuId(menuIds []int, rootId
 	pars = append(pars, menuIds)
 	sql := fmt.Sprintf(`UPDATE %s SET %s = ?, %s = %s + ? WHERE %s IN (%s)`, m.TableName(), SpeechRecognitionMenuCols.RootId, SpeechRecognitionMenuCols.Level, SpeechRecognitionMenuCols.Level, SpeechRecognitionMenuCols.SpeechRecognitionMenuId, utils.GetOrmInReplace(len(menuIds)))
 	//_, err = o.Raw(sql, pars).Exec()
-	err = global.DEFAULT_DmSQL.Exec(sql, pars).Error
+	err = global.DEFAULT_DmSQL.Exec(sql, pars...).Error
 	return
 }

+ 3 - 3
models/speech_recognition/speech_recognition_tag.go

@@ -120,7 +120,7 @@ func (m *SpeechRecognitionTag) GetItemByCondition(condition string, pars []inter
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -128,7 +128,7 @@ func (m *SpeechRecognitionTag) GetCountByCondition(condition string, pars []inte
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -144,7 +144,7 @@ func (m *SpeechRecognitionTag) GetItemsByCondition(condition string, pars []inte
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 3
models/speech_recognition/speech_recognition_tag_mapping.go

@@ -101,7 +101,7 @@ func (m *SpeechRecognitionTagMapping) GetItemByCondition(condition string, pars
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -109,7 +109,7 @@ func (m *SpeechRecognitionTagMapping) GetCountByCondition(condition string, pars
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -125,7 +125,7 @@ func (m *SpeechRecognitionTagMapping) GetItemsByCondition(condition string, pars
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 3
models/speech_recognition/speech_recognition_tag_menu.go

@@ -131,7 +131,7 @@ func (m *SpeechRecognitionTagMenu) GetItemByCondition(condition string, pars []i
 	}
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
 	//err = o.Raw(sql, pars).QueryRow(&item)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -139,7 +139,7 @@ func (m *SpeechRecognitionTagMenu) GetCountByCondition(condition string, pars []
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -155,7 +155,7 @@ func (m *SpeechRecognitionTagMenu) GetItemsByCondition(condition string, pars []
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 3 - 3
models/system/admin_verify_code_record.go

@@ -107,7 +107,7 @@ func (m *AdminVerifyCodeRecord) GetItemByCondition(condition string, pars []inte
 	//o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s LIMIT 1`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).Find(&item).Error
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).First(&item).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).First(&item).Error
 	return
 }
 
@@ -115,7 +115,7 @@ func (m *AdminVerifyCodeRecord) GetCountByCondition(condition string, pars []int
 	// o := orm.NewOrm()
 	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
 	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&count).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&count).Error
 	return
 }
 
@@ -131,7 +131,7 @@ func (m *AdminVerifyCodeRecord) GetItemsByCondition(condition string, pars []int
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
 	//_, err = o.Raw(sql, pars).QueryRows(&items)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Find(&items).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&items).Error
 	return
 }
 

+ 2 - 2
models/system/sys_role_admin.go

@@ -95,7 +95,7 @@ where 1=1`
 		sql += condition
 	}
 	//err = orm.NewOrm().Raw(sql, pars).QueryRow(&total)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&total).Error
+	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&total).Error
 	return
 }
 
@@ -170,7 +170,7 @@ func GetEnglishAuthRoleAdminList(condition string, pars []interface{}, startSize
 	//if err = o.Raw(totalSQl, pars).QueryRow(&total); err != nil {
 	//	return
 	//}
-	err = global.DEFAULT_DmSQL.Raw(totalSQl, pars).Scan(&total).Error
+	err = global.DEFAULT_DmSQL.Raw(totalSQl, pars...).Scan(&total).Error
 	if err != nil {
 		return
 	}