fix: time-zone issue, localhost issue
This commit is contained in:
@@ -51,12 +51,14 @@ func initDbClient() error {
|
||||
//}
|
||||
// defer dbClient.xEngine.Close() // 退出后关闭
|
||||
|
||||
if dbClient.IsShowSQL == true {
|
||||
if dbClient.IsShowSQL {
|
||||
dbClient.xEngine.ShowSQL(true)
|
||||
}
|
||||
dbClient.xEngine.SetConnMaxLifetime(dbClient.dbConnMaxLifetime)
|
||||
dbClient.xEngine.SetMaxIdleConns(dbClient.dbMaxIdleConns)
|
||||
dbClient.xEngine.SetMaxOpenConns(dbClient.dbMaxOpenConns)
|
||||
dbClient.xEngine.DatabaseTZ = time.Local // 必须
|
||||
dbClient.xEngine.TZLocation = time.Local // 必须
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -447,7 +449,7 @@ func XormInsertTalbeOne(tbInfo interface{}) (int64, error) {
|
||||
}
|
||||
|
||||
func XormGetDataBySQL(sql string) (*[]map[string]string, error) {
|
||||
log.Debug("XormGetDataBySQL processing... ")
|
||||
//log.Debug("XormGetDataBySQL processing... ")
|
||||
|
||||
rows := make([]map[string]string, 0)
|
||||
rows, err := dbClient.xEngine.QueryString(sql)
|
||||
|
||||
Reference in New Issue
Block a user