From 4640d29d7bcdd09a57743a669c9dad9bbbe8f5de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=A4=A7=E5=85=A8?= Date: Tue, 18 Jul 2017 18:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/task.go | 12 ++++++------ views/task/list.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/controllers/task.go b/controllers/task.go index aa87c45..a3cbe0a 100644 --- a/controllers/task.go +++ b/controllers/task.go @@ -29,15 +29,15 @@ func (this *TaskController) List() { page = 1 } groupId, _ := this.GetInt("groupid") - if groupId>0 { + if groupId > 0 { this.Ctx.SetCookie("groupid", strconv.Itoa(groupId)+"|job") - }else { + } else { arr := strings.Split(this.Ctx.GetCookie("groupid"), "|") - groupId,_= strconv.Atoi(arr[0]) + groupId, _ = strconv.Atoi(arr[0]) } filters := make([]interface{}, 0) - if groupId > 0 { + if groupId > 0 && groupId!=99 { filters = append(filters, "group_id", groupId) } result, count := models.TaskGetList(page, this.pageSize, filters...) @@ -46,7 +46,7 @@ func (this *TaskController) List() { // 分组列表 groups, _ := models.TaskGroupGetList(1, 100) groups_map := make(map[int]string) - for _,gname := range groups { + for _, gname := range groups { groups_map[gname.Id] = gname.GroupName } for k, v := range result { @@ -58,7 +58,7 @@ func (this *TaskController) List() { row["description"] = v.Description row["group_id"] = v.GroupId row["group_name"] = groups_map[v.GroupId] - row["is_odd"] = k%2 + row["is_odd"] = k % 2 e := jobs.GetEntryById(v.Id) if e != nil { diff --git a/views/task/list.html b/views/task/list.html index f7e1c2a..47f8681 100644 --- a/views/task/list.html +++ b/views/task/list.html @@ -39,7 +39,7 @@