Fix the soft delete bug.
This commit is contained in:
parent
a7bcc4d4fb
commit
a92e172d26
@ -462,13 +462,13 @@ func (this *MatterDao) SoftDelete(matter *Matter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//soft delete from db.
|
//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)
|
this.PanicError(db.Error)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//soft delete from db.
|
//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)
|
this.PanicError(db.Error)
|
||||||
|
|
||||||
//no need to delete its image cache.
|
//no need to delete its image cache.
|
||||||
|
@ -77,7 +77,7 @@ func (this *TankContext) OpenDb() {
|
|||||||
core.LOGGER.Panic("failed to connect mysql database")
|
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)
|
this.db.LogMode(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user