xyxie 1 månad sedan
förälder
incheckning
75da31370f

+ 2 - 2
models/data_manage/forum_chart_edb_mapping.go

@@ -11,7 +11,7 @@ type ForumChartEdbMapping struct {
 	ID int `gorm:"column:id;primaryKey" description:"主键"`
 	ChartInfoId int 
 	EdbInfoIds string 
-	CreatedTime time.Time 
+	CreateTime time.Time 
 	ModifyTime time.Time 
 }
 
@@ -26,7 +26,7 @@ func GetForumEdbInfoIdsByChartInfoId(chartInfoId int) (edbInfoIds string, err er
 // 新增
 func AddForumChartEdbMapping(chartInfoId int, edbInfoIds string) (err error) {
 	o := global.DbMap[utils.DbNameIndex]
-	sql := `INSERT INTO forum_chart_edb_mapping (chart_info_id, edb_info_ids, created_time, modify_time) VALUES (?, ?, ?, ?)`
+	sql := `INSERT INTO forum_chart_edb_mapping (chart_info_id, edb_info_ids, create_time, modify_time) VALUES (?, ?, ?, ?)`
 	err = o.Exec(sql, chartInfoId, edbInfoIds, time.Now(), time.Now()).Error
 	return
 }

+ 7 - 1
services/eta_forum/eta_forum_hub.go

@@ -525,7 +525,13 @@ func DeleteChart(chartInfoId int) (err error, errMsg string) {
 		err = fmt.Errorf("更新图表ID失败,Err:" + err.Error())
 		return
 	}
-
+	// 删除投研资源库里的图表和指标绑定关系
+	err = data_manage.DeleteForumChartEdbMapping(chartInfoId)
+	if err != nil {
+		errMsg = "删除投研资源库里的图表和指标绑定关系失败"
+		err = fmt.Errorf("删除投研资源库里的图表和指标绑定关系失败,Err:" + err.Error())
+		return
+	}
 	return
 }