// ajax func (c Tasks) AjaxTaskLogList(page int, pageSize int) revel.Result { user := c.SessionGetUser() taskLogs := models.SelectTaskLogListBy(user.UserId, page, pageSize) return c.RenderJsonSucWithData(map[string]interface{}{ "taskLogs": taskLogs, }) }
func (c Tasks) TaskList(groupId string) revel.Result { var tasks []models.Task var taskLogs []models.TaskLog if groupId == "" { user := c.SessionGetUser() tasks = models.SelectTaskListByUserId(user.UserId) taskLogs = models.SelectTaskLogListBy(user.UserId, 0, 10) } else { tasks = models.SelectTaskListByGroupId(groupId) } return c.Render(tasks, taskLogs) }