引用logger错误改log

This commit is contained in:
TsMask committed 2023-08-30 15:37:42 +08:00
1 parent f418b52a71
commit 29e3df8132
5 files changed
+26 -26

No files matched your search

+3 -3
View File
@@ -20,8 +20,8 @@ func RawDB(source string, sql string, parameters []any) ([]map[string]any, error
// 使用正则表达式替换连续的空白字符为单个空格
fmtSql := regexp.MustCompile(`\s+`).ReplaceAllString(sql, " ")
// logger.Infof("sql=> %v", fmtSql)
// logger.Infof("parameters=> %v", parameters)
// log.Infof("sql=> %v", fmtSql)
// log.Infof("parameters=> %v", parameters)
// 查询结果
var rows []map[string]any
@@ -40,7 +40,7 @@ func ExecDB(source string, sql string, parameters []any) (int64, error) {
// 使用正则表达式替换连续的空白字符为单个空格
fmtSql := regexp.MustCompile(`\s+`).ReplaceAllString(sql, " ")
// 执行结果
res, err := db.Exec(fmtSql, parameters)
res, err := db.Exec(append([]any{fmtSql}, parameters...)...)
if err != nil {
return 0, err
}
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/go-admin-team/go-admin-core/logger"
"ems.agt/lib/log"
)
const (
@@ -28,7 +28,7 @@ const (
func ParseStrToDate(dateStr, formatStr string) time.Time {
t, err := time.Parse(formatStr, dateStr)
if err != nil {
logger.Infof("utils ParseStrToDate err %v", err)
log.Infof("utils ParseStrToDate err %v", err)
return time.Time{}
}
return t