作者 陈志颖

test:测试删除用户

@@ -78,13 +78,15 @@ func (repository *ColumnSettingRepository) Remove(columnSetting *domain.ColumnSe @@ -78,13 +78,15 @@ func (repository *ColumnSettingRepository) Remove(columnSetting *domain.ColumnSe
78 78
79 // 批量删除 79 // 批量删除
80 if len(columnSettings) > 0 { 80 if len(columnSettings) > 0 {
81 - var columnSettingModels []models.ColumnSetting 81 + //var columnSettingModels []models.ColumnSetting
  82 + var ids []int64
82 for _, setting := range columnSettings { 83 for _, setting := range columnSettings {
83 - columnSettingModels = append(columnSettingModels, models.ColumnSetting{  
84 - Id: setting.Identify().(int64),  
85 - }) 84 + ids = append(ids, setting.Identify().(int64))
  85 + //columnSettingModels = append(columnSettingModels, models.ColumnSetting{
  86 + // Id: setting.Identify().(int64),
  87 + //})
86 } 88 }
87 - if _, err := tx.Model(&columnSettingModels).WherePK().Delete(); err != nil { 89 + if _, err := tx.Model((*models.ColumnSetting)(nil)).Where("id IN (?)", ids).Delete(); err != nil {
88 return nil, columnSettings, err 90 return nil, columnSettings, err
89 } 91 }
90 } 92 }