Ver Fonte

修改数据实时同步

longyu há 2 anos atrás
pai
commit
64f40b8255
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      models/edb_info.go

+ 4 - 4
models/edb_info.go

@@ -43,12 +43,12 @@ type EdbInfo struct {
 
 func (d *EdbInfo) GetEdbInfoItem(runMod, indexCode string) (item *EdbInfo, err error) {
 	if runMod == "release" {
-		err = global.MYSQL["hzdata"].WithContext(context.TODO()).Model(d).
-			Where("index_code = ?", indexCode).First(&item).Error
+		err = global.MYSQL["hzdata"].WithContext(context.TODO()).Table("edb_info").
+			Where("edb_code = ?", indexCode).First(&item).Error
 		return
 	} else {
-		err = global.DEFAULT_MYSQL.WithContext(context.TODO()).Model(d).
-			Where("index_code = ?", indexCode).First(&item).Error
+		err = global.DEFAULT_MYSQL.WithContext(context.TODO()).Table("edb_info").
+			Where("edb_code = ?", indexCode).First(&item).Error
 		return
 	}
 }