group complete

This commit is contained in:
withchao
2023-02-08 20:08:22 +08:00
parent b3ae69ce94
commit f20e9e71b7
15 changed files with 544 additions and 864 deletions
+4 -2
View File
@@ -87,9 +87,11 @@ func (w Writer) Printf(format string, args ...interface{}) {
fmt.Printf(format, args...)
}
func getDBConn(db *gorm.DB, tx []*gorm.DB) *gorm.DB {
func getDBConn(db *gorm.DB, tx []any) *gorm.DB {
if len(tx) > 0 {
return tx[0]
if txDb, ok := tx[0].(*gorm.DB); ok {
return txDb
}
}
return db
}