提交 e89760f3 编写于 作者: U Ulric Qin

code refactor

上级 02dd7048
......@@ -36,10 +36,14 @@ func (t *Target) Add() error {
return Insert(t)
}
return DB().Model(&Target{}).Where("ident = ?", t.Ident).Updates(map[string]interface{}{
"cluster": t.Cluster,
"update_at": t.UpdateAt,
}).Error
if obj.Cluster != t.Cluster {
return DB().Model(&Target{}).Where("ident = ?", t.Ident).Updates(map[string]interface{}{
"cluster": t.Cluster,
"update_at": t.UpdateAt,
}).Error
}
return nil
}
func (t *Target) FillGroup(cache map[int64]*BusiGroup) error {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册