Browse Source

修复页面错乱

kobe6258 3 days ago
parent
commit
fe7f6a63e2
1 changed files with 11 additions and 8 deletions
  1. 11 8
      models/report/report_free_layout.go

+ 11 - 8
models/report/report_free_layout.go

@@ -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
 }