From 99fcadee061972e08c690f6d7771b32509d34e7d Mon Sep 17 00:00:00 2001 From: qida Date: Sat, 28 May 2016 22:21:54 +0800 Subject: [PATCH] Update g_controllers.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容query中的日期时间参数。如:query=xxTime.lt:2016-01-01T23:22:21+08:00 --- g_controllers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g_controllers.go b/g_controllers.go index 49b5fd9..3bcfec8 100644 --- a/g_controllers.go +++ b/g_controllers.go @@ -245,7 +245,7 @@ func (c *{{controllerName}}Controller) GetAll() { // query: k:v,k:v if v := c.GetString("query"); v != "" { for _, cond := range strings.Split(v, ",") { - kv := strings.Split(cond, ":") + kv := strings.SplitN(cond, ":",2) if len(kv) != 2 { c.Data["json"] = errors.New("Error: invalid query key/value pair") c.ServeJSON()