소스 검색

修改bug

yjp 1 년 전
부모
커밋
d2208e4885
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      operations/operations.go

+ 4 - 2
operations/operations.go

@@ -127,8 +127,10 @@ func (op *Operations) AutoMigrate(tables ...Table) error {
 }
 
 func (op *Operations) Table(name string, args ...any) DBOperations {
-	op.processDB = op.initDB.Table(name, args...)
-	return op
+	return &Operations{
+		initDB:    op.initDB,
+		processDB: op.initDB.Table(name, args...),
+	}
 }
 
 func (op *Operations) Raw(sql string, values ...any) DBOperations {