Browse Source

指标替换 bug修改

xyxie 8 months ago
parent
commit
273e733c39
1 changed files with 6 additions and 0 deletions
  1. 6 0
      models/data_manage/edb_info_relation.go

+ 6 - 0
models/data_manage/edb_info_relation.go

@@ -383,6 +383,12 @@ func ReplaceRelationEdbInfoId(oldEdbInfo, newEdbInfo *EdbInfo, edbRelationIds []
 		return
 	}
 
+	// 更新code值
+	sql = ` UPDATE edb_info_relation SET relation_code=CONCAT_WS("_", edb_info_id,refer_object_id,refer_object_type,refer_object_sub_type)  WHERE relation_type=0 ` + sourceWhere + `  and edb_info_relation_id in (` + utils.GetOrmInReplace(len(edbRelationIds)) + `)`
+	_, err = o.Raw(sql, edbRelationIds).Exec()
+	if err != nil {
+		return
+	}
 	// 新增间接引用
 	relationCodesMap := make(map[string]struct{}, 0)
 	if len(relationList) > 0 {