Esempio n. 1
0
// 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,
	})
}
Esempio n. 2
0
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)
}