瀏覽代碼

批量修改

kobe6258 1 月之前
父節點
當前提交
df9f07694f

+ 5 - 4
controllers/data_manage/yongyi_data.go

@@ -980,10 +980,11 @@ func (this *EdbInfoController) ExportYongyiList() {
 
 		if len(childClassify) > 0 {
 			condition += `AND classify_id IN (` + utils.GetOrmInReplace(len(childClassify)) + `)`
-			//for _, child := range childClassify {
-			//	pars = append(pars, child.ClassifyId)
-			//}
-			pars = append(pars, childClassify)
+			var classifyIdList []int
+			for _, child := range childClassify {
+				classifyIdList = append(classifyIdList, child.ClassifyId)
+			}
+			pars = append(pars, classifyIdList)
 		} else {
 			condition += ` AND classify_id=?`
 			pars = append(pars, classifyId)

+ 4 - 4
models/data_manage/future_good/future_good_edb_info_data.go

@@ -36,7 +36,7 @@ type FutureGoodEdbDataListResp struct {
 
 // FutureGoodEdbDataItem 期货指标数据列表数据
 type FutureGoodEdbDataItem struct {
-	FutureGoodEdbDataId int     `orm:"column(future_good_edb_data_id);pk" gorm:"primaryKey" `
+	FutureGoodEdbDataId int     `gorm:"column:future_good_edb_data_id;primaryKey" `
 	FutureGoodEdbInfoId int     `description:"期货指标id"`
 	FutureGoodEdbCode   string  `description:"期货指标code"`
 	FutureGoodEdbName   string  `description:"期货指标名称"`
@@ -55,7 +55,7 @@ type FutureGoodEdbDataItem struct {
 	CreateTime          string
 }
 
-func (m *FutureGoodEdbDataItem) AfterFind(db *gorm.DB) (err error) {
+func (m *FutureGoodEdbDataItem) AfterFind(tx *gorm.DB) (err error) {
 	if utils.NeedDateOrTimeFormat(utils.DbDriverName) {
 		if m.CreateTime != "" {
 			m.CreateTime = utils.GormDateStrToDateTimeStr(m.CreateTime)
@@ -90,8 +90,8 @@ func GetFutureGoodEdbDataList(condition string, pars []interface{}, startSize, p
 	sql += `ORDER BY data_time desc,modify_time DESC LIMIT ?,?`
 	pars = append(pars, startSize)
 	pars = append(pars, pageSize)
-	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&list).Error
-
+	//err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Scan(&list).Error
+	err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&list).Error
 	return
 }