Fix the soft delete bug.

This commit is contained in:
lishuang 2020-07-12 20:52:20 +08:00
parent a7bcc4d4fb
commit a92e172d26
2 changed files with 3 additions and 3 deletions

View File

@ -462,13 +462,13 @@ func (this *MatterDao) SoftDelete(matter *Matter) {
}
//soft delete from db.
db := core.CONTEXT.GetDB().Model(&Matter{}).Where("uuid = ?", matter.Uuid).Update(map[string]interface{}{"deleted": 1, "delete_time": time.Now()})
db := core.CONTEXT.GetDB().Model(&Matter{}).Where("uuid = ?", matter.Uuid).Update(map[string]interface{}{"deleted": true, "delete_time": time.Now()})
this.PanicError(db.Error)
} else {
//soft delete from db.
db := core.CONTEXT.GetDB().Model(&Matter{}).Where("uuid = ?", matter.Uuid).Update(map[string]interface{}{"deleted": 1, "delete_time": time.Now()})
db := core.CONTEXT.GetDB().Model(&Matter{}).Where("uuid = ?", matter.Uuid).Update(map[string]interface{}{"deleted": true, "delete_time": time.Now()})
this.PanicError(db.Error)
//no need to delete its image cache.

View File

@ -77,7 +77,7 @@ func (this *TankContext) OpenDb() {
core.LOGGER.Panic("failed to connect mysql database")
}
//whether open the db log. (only true when debug)
//whether open the db sql log. (only true when debug)
this.db.LogMode(false)
}