From 1da1fd27d88e935c1f8f246f04ea9e0ebcc76afb Mon Sep 17 00:00:00 2001 From: timerzz Date: Tue, 27 Aug 2024 14:08:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8Dproviders=E7=9A=84ids?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- structs/storage/provider.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 }