From 55126e2470b7da4b30401d4523bf85a7b6883b97 Mon Sep 17 00:00:00 2001 From: "LinskRuis.32" Date: Mon, 12 Oct 2020 21:22:32 +0800 Subject: [PATCH] bugs --- service/mv.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/service/mv.go b/service/mv.go index 602bf9a..d42102c 100644 --- a/service/mv.go +++ b/service/mv.go @@ -17,6 +17,10 @@ func MoveModels() { return } for _, v := range olds { + id, err := v.GetInt("id") + if err != nil { + continue + } del, err := v.GetInt("del") if err != nil { continue @@ -38,14 +42,14 @@ func MoveModels() { } _, err = comm.Db.Insert(ne) if err == nil { - mvPlugin(ne) + mvPlugin(id, ne) } } } -func mvPlugin(md *model.TModel) { +func mvPlugin(tid int64, md *model.TModel) { var olds []*ruisUtil.Map - err := comm.Dbold.SQL("select * from t_plugin").Find(&olds) + err := comm.Dbold.SQL("select * from t_plugin where tid=?", tid).Find(&olds) if err != nil { fmt.Println("find model err:" + err.Error()) return