fix: custom indicator exist issue

This commit is contained in:
simonzhangsz
2024-12-13 11:11:34 +08:00
parent f5ebd1c581
commit 3dc6c09d73

View File

@@ -174,7 +174,7 @@ func (k *KpiCTitle) Post(c *gin.Context) {
}
userName := ctx.LoginUserToUserName(c)
title.CreatedBy = &userName
result := dborm.DefaultDB().Where("ne_type=? and (kpi_id=? or title=?)", title.NeType, title.KpiID, title.Title).First(&title)
result := dborm.DefaultDB().Where("ne_type=? and (kpi_id=? or title=?) and stauts!='Deleted'", title.NeType, title.KpiID, title.Title).First(&title)
if result.RowsAffected > 0 {
c.JSON(http.StatusOK, services.ErrResp("custom indicator already exist"))
return