This commit is contained in:
LinskRuis.32 2020-10-12 21:22:32 +08:00
parent 61115cfa8b
commit 55126e2470

View File

@ -17,6 +17,10 @@ func MoveModels() {
return return
} }
for _, v := range olds { for _, v := range olds {
id, err := v.GetInt("id")
if err != nil {
continue
}
del, err := v.GetInt("del") del, err := v.GetInt("del")
if err != nil { if err != nil {
continue continue
@ -38,14 +42,14 @@ func MoveModels() {
} }
_, err = comm.Db.Insert(ne) _, err = comm.Db.Insert(ne)
if err == nil { if err == nil {
mvPlugin(ne) mvPlugin(id, ne)
} }
} }
} }
func mvPlugin(md *model.TModel) { func mvPlugin(tid int64, md *model.TModel) {
var olds []*ruisUtil.Map 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 { if err != nil {
fmt.Println("find model err:" + err.Error()) fmt.Println("find model err:" + err.Error())
return return