diff --git a/structs/storage/provider.go b/structs/storage/provider.go index f20e918..793011b 100644 --- a/structs/storage/provider.go +++ b/structs/storage/provider.go @@ -3,7 +3,6 @@ package storage import ( "fmt" "strconv" - "strings" v2 "gitea.timerzz.com/kedaya_haitao/common/structs/v2" "github.com/samber/lo" @@ -82,7 +81,7 @@ func (p *providerApi) Update(provider v2.Provider) error { }) // 删除已经没有的CalculateProcess - if err := tx.Where(fmt.Sprintf("id not in (%s) AND owner_id = ? AND kind = ?", strings.Join(ids, ",")), provider.ID, "provider").Delete(&v2.CalculateProcess{}).Error; err != nil { + if err := tx.Not(ids).Where("owner_id = ? AND kind = ?", provider.ID, "provider").Delete(&v2.CalculateProcess{}).Error; err != nil { return err }