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

This commit is contained in:
linwenxiang
2021-03-05 15:13:36 +08:00
parent 39dd1ee6f8
commit 75711922b4
47 changed files with 267 additions and 275 deletions
+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)
}