Эх сурвалжийг харах

Merge branch 'feature/eta_2.5.4_report_free_layout' into debug

kobe6258 4 өдөр өмнө
parent
commit
db1bf7e2c3

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