Ver Fonte

// GetServerTime 获取服务器时间: 返回前先to_char

deng.yinping há 1 ano atrás
pai
commit
4be4252c8e
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      models/common.go

+ 2 - 1
models/common.go

@@ -739,7 +739,8 @@ func GetImageConfigs(userId int64, imageType int) ([]Szdz2imageconfig, error) {
 func GetServerTime() (*string, error) {
 	engine := db.GetEngine()
 
-	rst, err := engine.QueryString("select sysdate from dual")
+	// rst, err := engine.QueryString("select sysdate from dual")
+	rst, err := engine.QueryString("select to_char(sysdate, 'yyyy-MM-dd hh24:mi:ss') \"SYSDATE\" from dual")
 	if err != nil {
 		return nil, err
 	}