|
@@ -161,10 +161,11 @@ func BatchInsertOrUpdatePages(tx *gorm.DB, list []*ReportFreeLayout, isChapter b
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- err = tx.Model(&ReportFreeLayout{}).Clauses(clause.OnConflict{
|
|
|
- Columns: []clause.Column{{Name: "id"}},
|
|
|
- DoUpdates: clause.AssignmentColumns([]string{"content", "content_struct", "modify_time"}),
|
|
|
- }).CreateInBatches(list, len(list)).Error
|
|
|
+ //err = tx.Model(&ReportFreeLayout{}).Clauses(clause.OnConflict{
|
|
|
+ // Columns: []clause.Column{{Name: "id"}},
|
|
|
+ // DoUpdates: clause.AssignmentColumns([]string{"content", "content_struct", "modify_time"}),
|
|
|
+ //}).CreateInBatches(list, len(list)).Error
|
|
|
+ err = tx.Model(&ReportFreeLayout{}).CreateInBatches(list, len(list)).Error
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -175,10 +176,12 @@ func BatchInsertOrUpdatePages(tx *gorm.DB, list []*ReportFreeLayout, isChapter b
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- err = tx.Model(&ReportFreeLayout{}).Clauses(clause.OnConflict{
|
|
|
- Columns: []clause.Column{{Name: "id"}},
|
|
|
- DoUpdates: clause.AssignmentColumns([]string{"content", "content_struct", "page", "modify_time"}),
|
|
|
- }).CreateInBatches(list, len(list)).Error
|
|
|
+ err = tx.Model(&ReportFreeLayout{}).CreateInBatches(list, len(list)).Error
|
|
|
+ //.Clauses(clause.OnConflict{
|
|
|
+ // Columns: []clause.Column{{Name: "id"}},
|
|
|
+ // DoUpdates: clause.AssignmentColumns([]string{"content", "content_struct", "page", "modify_time"}),
|
|
|
+ //})
|
|
|
+
|
|
|
}
|
|
|
return
|
|
|
}
|