Merge pull request #244 from qida/develop

兼容query中的日期、时间参数。
This commit is contained in:
astaxie 2016-08-18 23:18:37 +08:00 committed by GitHub
commit d54ba3291b
1 changed files with 1 additions and 1 deletions

View File

@ -255,7 +255,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()