From 7047dd5bb1e08302480b425284927d66ca1a74eb Mon Sep 17 00:00:00 2001 From: "Mr.Li" Date: Sun, 23 Apr 2023 17:08:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4sql=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biz/config/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/biz/config/config.go b/biz/config/config.go index 8d10f8a..296924f 100644 --- a/biz/config/config.go +++ b/biz/config/config.go @@ -86,7 +86,8 @@ func (t Task) GetSql(params map[string]interface{}) string { m := regexp.MustCompile("({[a-zA-Z0-9]+})") if strings.Trim(t.Elt, " ") != "" { - wehre := m.ReplaceAllFunc([]byte(t.Elt), func(b []byte) []byte { + sql = sql + " where " + t.Elt + build := m.ReplaceAllFunc([]byte(sql), func(b []byte) []byte { field := string(b[1 : len(b)-1]) if val, ok := params[field]; ok { @@ -95,7 +96,7 @@ func (t Task) GetSql(params map[string]interface{}) string { return b }) - sql = sql + " where " + string(wehre) + sql = string(build) } if strings.Trim(t.Order, " ") != "" {