作者 tangxvhui
@@ -44,7 +44,7 @@ func (repository *ArticleRepository) Update(ctx context.Context, conn transactio @@ -44,7 +44,7 @@ func (repository *ArticleRepository) Update(ctx context.Context, conn transactio
44 return nil, err 44 return nil, err
45 } 45 }
46 queryFunc := func() (interface{}, error) { 46 queryFunc := func() (interface{}, error) {
47 - tx = tx.Model(m).Updates(m) 47 + tx = tx.Model(m).Save(m)
48 return nil, tx.Error 48 return nil, tx.Error
49 } 49 }
50 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { 50 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
@@ -42,7 +42,7 @@ func (repository *ArticleSectionRepository) Update(ctx context.Context, conn tra @@ -42,7 +42,7 @@ func (repository *ArticleSectionRepository) Update(ctx context.Context, conn tra
42 return nil, err 42 return nil, err
43 } 43 }
44 queryFunc := func() (interface{}, error) { 44 queryFunc := func() (interface{}, error) {
45 - tx = tx.Model(m).Updates(m) 45 + tx = tx.Model(m).Save(m)
46 return nil, tx.Error 46 return nil, tx.Error
47 } 47 }
48 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { 48 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {