调整log代码,兼容zap扩展支持fields

This commit is contained in:
linwenxiang committed 2021-03-05 15:13:36 +08:00
1 parent 39dd1ee6f8
commit 75711922b4
47 files changed
+267 -275

No files matched your search

+2 -3
View File
@@ -2,18 +2,17 @@ package models
import (
"fmt"
"go-admin/tools/app"
"gorm.io/gorm"
"io/ioutil"
"log"
"strings"
"go-admin/common/global"
)
func InitDb(db *gorm.DB) (err error) {
filePath := "config/db.sql"
err = ExecSql(db, filePath)
if global.Driver == "postgres" {
if app.Driver == "postgres" {
filePath = "config/pg.sql"
err = ExecSql(db, filePath)
}