摘要: 在使用Update更新数据时一定要将where条件放在update前面,否则where不会生效,将更新所有数据 正确的写法 // 条件更新 db.Model(&User{}).Where("id= ?", ID).Update("name", "hello") 错误的写法 // 条件更新 db.Mo 阅读全文
posted @ 2022-08-21 12:58 夜灵杉 阅读(136) 评论(0) 推荐(0)