[FIX] fix save in codecheck and event

This commit is contained in:
Bay 2017-12-28 10:16:09 +08:00
parent 039ce238cf
commit 2f877cac6a
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ func (c *CodeCheckResultDaoImpl) AddModel(mo model.Interface) error {
fmt.Errorf("codecheck result is exist")
update(result, &oldResult)
if err := c.DB.Save(oldResult).Error; err != nil {
if err := c.DB.Save(&oldResult).Error; err != nil {
return err
}
return nil
@ -52,7 +52,7 @@ func (c *CodeCheckResultDaoImpl) UpdateModel(mo model.Interface) error {
var oldResult model.CodeCheckResult
if ok := c.DB.Where("service_id=?", result.ServiceID).Find(&oldResult).RecordNotFound(); !ok {
update(result, &oldResult)
if err := c.DB.Save(oldResult).Error; err != nil {
if err := c.DB.Save(&oldResult).Error; err != nil {
return err
}
}

View File

@ -53,7 +53,7 @@ func (c *EventDaoImpl) UpdateModel(mo model.Interface) error {
finalUpdateEvent(result, &oldResult)
oldB, _ := json.Marshal(oldResult)
logrus.Infof("update event to %s", string(oldB))
if err := c.DB.Save(oldResult).Error; err != nil {
if err := c.DB.Save(&oldResult).Error; err != nil {
return err
}
}