diff --git a/features/pm/kpi_c_title/controller.go b/features/pm/kpi_c_title/controller.go index 56bba7af..68d3e5c7 100644 --- a/features/pm/kpi_c_title/controller.go +++ b/features/pm/kpi_c_title/controller.go @@ -126,7 +126,7 @@ func (k *KpiCTitle) Post(c *gin.Context) { c.JSON(http.StatusBadRequest, services.ErrResp(err.Error())) return } - result := dborm.DefaultDB().Where("ne_type=? and kpi_id=?", title.NeType, title.KpiID).First(&title) + result := dborm.DefaultDB().Where("ne_type=? and (kpi_id=? or title=?)", title.NeType, title.KpiID, title.Title).First(&title) if result.RowsAffected > 0 { c.JSON(http.StatusInternalServerError, services.ErrResp("target kpiC title already exist")) return