-
Notifications
You must be signed in to change notification settings - Fork 9
Delete删除数据
Tuuz edited this page Jun 20, 2022
·
4 revisions
func Api_delete_byToken(qq, token interface{}) bool {
db := tuuz.Db().Table(table)
where := map[string]interface{}{
"qq": qq,
"token": token,
}
db.Where(where)
_, err := db.Delete()
if err != nil {
Log.Dbrr(err, tuuz.FUNCTION_ALL())
return false
} else {
return true
}
}
type Interface struct {
Db gorose.IOrm
}
func (self *Interface) Api_delete(id interface{}) bool {
db := self.Db.Table(Table)
where := map[string]interface{}{
"id": id,
}
db.Where(where)
_, err := db.Delete()
if err != nil {
Log.Dbrr(err, tuuz.FUNCTION_ALL())
return false
} else {
return true
}
}