-
Notifications
You must be signed in to change notification settings - Fork 9
Update方法
Tuuz edited this page Jun 20, 2022
·
3 revisions
func Api_update_img(id, img interface{}) bool {
db := tuuz.Db().Table(Table)
where := map[string]interface{}{
"id": id,
}
db.Where(where)
data := map[string]interface{}{
"img": img,
}
db.Data(data)
_, err := db.Update()
if err != nil {
Log.Dbrr(err, tuuz.FUNCTION_ALL())
return false
} else {
return true
}
}
func (self *Interface) Api_update_img(id, parent_id, img interface{}) bool {
db := self.Db.Table(Table)
where := map[string]interface{}{
"id": id,
"parent_id": parent_id,
}
db.Where(where)
data := map[string]interface{}{
"img": img,
}
db.Data(data)
_, err := db.Update()
if err != nil {
Log.Dbrr(err, tuuz.FUNCTION_ALL())
return false
} else {
return true
}
}