예제 #1
0
파일: job.go 프로젝트: zbzzbd/beego
func (c *JobController) getInitData() {
	c.Data["Types"] = c.getRequires()
	c.Data["Departments"] = departments
	c.Data["is_edit"] = false

	c.Data["ProjectNames"], _ = project.NewProjectList().GetAllProjectNames()
	c.Data["Status"] = c.getinitStatusData()

	users, err := user.GetList()
	if err == nil {
		c.Data["Employees"] = users
	}
	c.Data["BussinessMen"] = user.BussinessMen
}
예제 #2
0
파일: produce.go 프로젝트: zbzzbd/beego
func (c *ProduceController) GetInitData() {
	c.Data["Types"] = c.getRequires()
	c.Data["Departments"] = departments

	filter := make(map[string]interface{})
	projectList := project.NewProjectList()
	projects, err := projectList.GetList(filter)
	if err == nil {
		c.Data["Projects"] = projects
	}

	users, err := user.GetList()
	if err == nil {
		c.Data["Employees"] = users
	}
}
예제 #3
0
파일: user.go 프로젝트: zbzzbd/beego
func (c *UserController) GetViewUsers() {
	allUser, _ := user.GetList()

	companyCode := c.GetString("company")
	role := c.GetString("role")
	users := make([]*models.User, 0)
	for _, v := range allUser {
		if v.Company.Code == companyCode {
			if role == "" || v.Roles == role {
				users = append(users, v)
			}
		}
	}

	c.Data["allUsers"] = users
}
예제 #4
0
파일: complaint.go 프로젝트: zbzzbd/beego
func (c *ComplaintController) GetInitData() {
	response := []string{"1", "0"}
	c.Data["Types"] = c.getRequires()
	c.Data["Departments"] = departments
	c.Data["Response"] = response

	//获取project对象
	filter := make(map[string]interface{})
	projectList := project.NewProjectList()
	projects, err := projectList.GetList(filter)
	if err == nil {
		c.Data["Projects"] = projects
	}

	//获取作业单元
	users, err := user.GetList()
	if err == nil {
		c.Data["Employees"] = users

	}

}